com.facetmap.example.movies
Class MovieResourceSpace

java.lang.Object
  extended by com.facetmap.example.movies.MovieResourceSpace
All Implemented Interfaces:
ResourceSpace

public class MovieResourceSpace
extends java.lang.Object
implements ResourceSpace

Wraps a MovieList in a ResourceSpace implementation, backed by the classification scheme provided by MovieFacets. This ResourceSpace will contain Movie objects, and like all ResourceSpace objects, it has an underlying FacetSpace which describes how its resources are classified. In this case we take that FacetSpace from MovieFacets.singleton().


Field Summary
protected  FacetSpace facetSpace
           
protected  java.util.Map movies
           
 
Constructor Summary
MovieResourceSpace(MovieList movieList)
           
 
Method Summary
 java.util.Iterator getAll()
          Returns all resources.
 Resource getById(int id)
           
 FacetSpace getFacetSpace()
          Return the classification scheme by which these Resources are classified.
 int getResourceCount()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

movies

protected java.util.Map movies

facetSpace

protected FacetSpace facetSpace
Constructor Detail

MovieResourceSpace

public MovieResourceSpace(MovieList movieList)
Method Detail

getAll

public java.util.Iterator getAll()
                          throws InternalException
Description copied from interface: ResourceSpace
Returns all resources. Order depends on implementation. This method can be used to communicate resources between maps or to output an entire resource space.

Specified by:
getAll in interface ResourceSpace
Throws:
InternalException

getById

public Resource getById(int id)
                 throws InternalException
Specified by:
getById in interface ResourceSpace
Throws:
InternalException

getFacetSpace

public FacetSpace getFacetSpace()
Description copied from interface: ResourceSpace
Return the classification scheme by which these Resources are classified.

Specified by:
getFacetSpace in interface ResourceSpace

getResourceCount

public int getResourceCount()
                     throws InternalException
Specified by:
getResourceCount in interface ResourceSpace
Throws:
InternalException