|
copyright The Portico Project 2008. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.portico.shared.model.ObjectModel
public class ObjectModel
This class represents a HLA FOM. It contains a set of object and interaction classes (routing
spaces not yet supported) which can be fetch via handle. It also contains links to the object
and interaction roots of the model. In order to provide support for the notion of a dynamic-FOM,
instances can be modified at any time unless the model has been locked with a call to the
lock()
method. After this call, the model will become static and function as
normally expected within the HLA (note: models can be unlocked).
Field Summary | |
---|---|
private int |
handle
|
private Map<Integer,ICMetadata> |
iclasses
|
private ICMetadata |
icroot
|
static int |
INVALID_HANDLE
|
private boolean |
locked
|
static int |
MAX_MOM_HANDLE
The maximum handle value for MOM data |
private Map<Integer,OCMetadata> |
oclasses
|
private OCMetadata |
ocroot
|
private int |
privilegeToDelete
|
private static long |
serialVersionUID
|
private Map<Integer,Space> |
spaces
|
private HLAVersion |
version
|
Constructor Summary | |
---|---|
ObjectModel()
Creates a new instance with the default of Version.V1_3 |
|
ObjectModel(HLAVersion version)
Creates a new instance with the given version |
Method Summary | |
---|---|
void |
addInteractionClass(ICMetadata ic)
Add the given interaction class to this model. |
void |
addObjectClass(OCMetadata oc)
Add the given object class to this model. |
void |
addSpace(Space space)
Add the given Space to this model. |
private int |
generateHandle()
|
Set<ICMetadata> |
getAllInteractionClasses()
Get a set of all the interaction classes currently contained within this FOM. |
Set<OCMetadata> |
getAllObjectClasses()
Get a set of all the object classes currently contained within this FOM. |
Collection<Space> |
getAllSpaces()
Returns the collection of all spaces declared in the FOM |
ACMetadata |
getAttributeClass(int classHandle,
String attributeName)
This method will fetch the ACMetadata for the attribute of the given name in the
class of the given handle. |
ICMetadata |
getInteractionClass(int handle)
Fetch the object class of the given handle in this model. |
ICMetadata |
getInteractionClass(String name)
Find the interaction class with the given name and return it. |
int |
getInteractionClassHandle(String name)
Get the handle of the class with the given name. |
String |
getInteractionClassName(int handle)
Get the name of the interaction class represented by the given handle in this model. |
ICMetadata |
getInteractionRoot()
Get the class that represents InteractionRoot (or HLAInteractionRoot in 1516). |
OCMetadata |
getObjectClass(int handle)
Fetch the object class of the given handle in this model. |
OCMetadata |
getObjectClass(String name)
Fetch the object class with the given name and return it. |
int |
getObjectClassHandle(String name)
Get the handle of the class with the given name. |
String |
getObjectClassName(int handle)
Get the name of the object class represented by the given handle in this model. |
OCMetadata |
getObjectRoot()
Get the class that represents ObjectRoot (or HLAObjectRoot in 1516). |
int |
getPrivilegeToDelete()
This method will get the handle of the privilege to delete attribute. |
Space |
getSpace(int spaceHandle)
Fetch the space contained in this model that has the given handle and return it. |
Space |
getSpace(String name)
Fetch the space contained in this model that has the given name and return it. |
void |
lock()
Locks this model so that changes can no longer be made. |
static void |
mommify(ObjectModel model)
DO NOT USE!!! |
ACMetadata |
newAttribute(String name)
Creates a new ACMetadata instance with the given name and a generated
handle. |
Dimension |
newDimension(String name)
Creates a new Dimension instance with the given name and generates a
FOM-unique handle for it. |
ICMetadata |
newInteraction(String name)
Creates a new ICMetadata instance with the given name and a generaetd
handle. |
OCMetadata |
newObject(String name)
Creates a new OCMetadata instance with the given name and a generaetd
handle. |
PCMetadata |
newParameter(String name)
Creates a new PCMetadata instance with the given name and a generated
handle. |
Space |
newSpace(String name)
Creates a new Space instance with the given name and generates a FOM-unique
handle for it. |
ICMetadata |
removeInteractionClass(int handle)
Remove and return the given interaction class from this model. |
OCMetadata |
removeObjectClass(int handle)
Remove and return the given object class from this model. |
void |
setInteractionRoot(ICMetadata root)
Designate the given class as the interaction root of this FOM. |
void |
setObjectRoot(OCMetadata root)
Designate the given class as the object root of this FOM. |
String |
toString()
|
void |
unlock()
Unlocks this model so that changes can be made once again |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
public static final int INVALID_HANDLE
public static final int MAX_MOM_HANDLE
private int handle
private HLAVersion version
private boolean locked
private Map<Integer,OCMetadata> oclasses
private Map<Integer,ICMetadata> iclasses
private Map<Integer,Space> spaces
private OCMetadata ocroot
private ICMetadata icroot
private int privilegeToDelete
Constructor Detail |
---|
public ObjectModel()
public ObjectModel(HLAVersion version)
Method Detail |
---|
public Space getSpace(int spaceHandle)
public Space getSpace(String name)
public Collection<Space> getAllSpaces()
public void addSpace(Space space)
Space
to this model. If a space with the same handle already
exists, it will be overwritten with this new space. If the model has been locked, this
request will be ignored.
public OCMetadata getObjectClass(int handle)
public OCMetadata getObjectClass(String name)
public ACMetadata getAttributeClass(int classHandle, String attributeName)
ACMetadata
for the attribute of the given name in the
class of the given handle. If the name doesn't represent a valid attribute, or the handle
doesn't represent a valid class, null will be returned.
public OCMetadata getObjectRoot()
public void setObjectRoot(OCMetadata root)
lock()
'ed. This request will also be
ignored if the fully qualified name of the class is not "ObjectRoot" (for 1.3) or
"HLAObjectRoot" (for 1516).
public Set<OCMetadata> getAllObjectClasses()
public void addObjectClass(OCMetadata oc)
public OCMetadata removeObjectClass(int handle)
public int getObjectClassHandle(String name)
INVALID_HANDLE
will be returned.
public String getObjectClassName(int handle)
public int getPrivilegeToDelete()
INVALID_HANDLE
if
there is no currently set object root.public ICMetadata getInteractionClass(int handle)
public ICMetadata getInteractionClass(String name)
public ICMetadata getInteractionRoot()
public void setInteractionRoot(ICMetadata root)
lock()
'ed. This request will also be
ignored if the fully qualified name of the class is not "InteractionRoot" (for 1.3) or
"HLAInteractionRoot" (for 1516).
public Set<ICMetadata> getAllInteractionClasses()
public void addInteractionClass(ICMetadata ic)
public ICMetadata removeInteractionClass(int handle)
public int getInteractionClassHandle(String name)
INVALID_HANDLE
will be returned.
public String getInteractionClassName(int handle)
public void lock()
public void unlock()
public OCMetadata newObject(String name)
OCMetadata
instance with the given name and a generaetd
handle.
public ACMetadata newAttribute(String name)
ACMetadata
instance with the given name and a generated
handle.
public ICMetadata newInteraction(String name)
ICMetadata
instance with the given name and a generaetd
handle.
public PCMetadata newParameter(String name)
PCMetadata
instance with the given name and a generated
handle.
public Space newSpace(String name)
Space
instance with the given name and generates a FOM-unique
handle for it.
public Dimension newDimension(String name)
Dimension
instance with the given name and generates a
FOM-unique handle for it.
private int generateHandle()
public String toString()
toString
in class Object
public static void mommify(ObjectModel model)
|
copyright The Portico Project 2008. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |