com.facetmap.simple
Class SimpleResourceSpace
java.lang.Object
com.facetmap.simple.SimpleResourceSpace
- All Implemented Interfaces:
- ResourceSpace
- public class SimpleResourceSpace
- extends java.lang.Object
- implements ResourceSpace
An entirely RAM-based home. There is some commented-out code in here
that can be used to turn it into a home that uses database for
persistence.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
map
protected Map map
resources
protected java.util.Vector resources
SimpleResourceSpace
public SimpleResourceSpace(Map map)
getResourceCount
public int getResourceCount()
- Specified by:
getResourceCount in interface ResourceSpace
clear
public void clear()
create
public SimpleResource create(SimpleResource r)
- Merely indexes the resource, sets its ID, and returns it. This
SimpleResourceSpace does not make a copy of the resource, so
don't go changing the resource unless you mean to change it in Home.
countResources
public int countResources()
getById
public Resource getById(int id)
- Will return null if the passed id has no resource.
- Specified by:
getById in interface ResourceSpace
getAll
public java.util.Collection getAll()
- Returns all resources, unsorted.
- Specified by:
getAll in interface ResourceSpace