copyright The Portico Project 2008.

org.portico.shared.model
Class Space

java.lang.Object
  extended by org.portico.shared.model.Space
All Implemented Interfaces:
Serializable

public class Space
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
private  Map<Integer,Dimension> dimensions
           
private  int handle
           
private  ObjectModel model
           
private  String name
           
private static long serialVersionUID
           
 
Constructor Summary
Space(String name, int handle)
           
 
Method Summary
 boolean addDimension(Dimension dimension)
          Adds the given dimension to this space.
 Dimension getDimension(int dimensionHandle)
          Find the contained Dimension of the given handle and return it.
 Dimension getDimension(String dimensionName)
          Find the contained Dimension of the given name and return it.
 int getDimensionHandle(String dimensionName)
          Return the handle for the contained dimension of the given handle.
 String getDimensionName(int dimensionHandle)
          Return the name of the contained dimension with the given handle.
 Set<Dimension> getDimensions()
          Get a set of all the dimensions contained in this space.
 int getHandle()
           
 ObjectModel getModel()
           
 String getName()
           
 boolean hasDimension(int dimensionHandle)
          Returns true if there is a dimension with the given handle inside this space.
 boolean hasDimension(String dimensionName)
          Returns true if there is a dimension of the given name inside this space.
 Dimension removeDimension(int handle)
          Remove and return the contained dimension with the given handle.
 void setModel(ObjectModel model)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

name

private String name

handle

private int handle

dimensions

private Map<Integer,Dimension> dimensions

model

private ObjectModel model
Constructor Detail

Space

public Space(String name,
             int handle)
Method Detail

addDimension

public boolean addDimension(Dimension dimension)
Adds the given dimension to this space. If the name of the dimension is the same as one already in this class, the request will be ignored and false will be returned. Otherwise, the dimension will be added and true will be returned.


removeDimension

public Dimension removeDimension(int handle)
Remove and return the contained dimension with the given handle. If there is no dimension by that handle, null will be returned.


getDimensions

public Set<Dimension> getDimensions()
Get a set of all the dimensions contained in this space. If there are none, an empty set is returned.


getDimension

public Dimension getDimension(String dimensionName)
Find the contained Dimension of the given name and return it. If there is no Dimension, null will be returned.


getDimension

public Dimension getDimension(int dimensionHandle)
Find the contained Dimension of the given handle and return it. If there is no Dimension, null will be returned.


hasDimension

public boolean hasDimension(String dimensionName)
Returns true if there is a dimension of the given name inside this space. Returns false otherwise.


hasDimension

public boolean hasDimension(int dimensionHandle)
Returns true if there is a dimension with the given handle inside this space. Returns false otherwise.


getDimensionHandle

public int getDimensionHandle(String dimensionName)
Return the handle for the contained dimension of the given handle. If there is no dimension with that handle, ObjectModel.INVALID_HANDLE is returned.


getDimensionName

public String getDimensionName(int dimensionHandle)
Return the name of the contained dimension with the given handle. If the dimension doesn't exist, null is returned.


getHandle

public int getHandle()

getName

public String getName()

getModel

public ObjectModel getModel()

setModel

public void setModel(ObjectModel model)

toString

public String toString()
Overrides:
toString in class Object

copyright The Portico Project 2008.