copyright The Portico Project 2008.

org.portico.shared.model
Class OCMetadata

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

public class OCMetadata
extends Object
implements Serializable

This class contains metadata information about a FOM object class

See Also:
Serialized Form

Field Summary
private  Map<Integer,ACMetadata> attributes
           
private  Set<OCMetadata> children
           
private  int handle
           
private  ObjectModel model
           
private  String name
           
private  OCMetadata parent
           
private  String qualifiedName
           
private static long serialVersionUID
           
private  String vsafeQualifiedName
           
 
Constructor Summary
OCMetadata(String name, int handle)
          NOTE: This constructor should generally not be used.
 
Method Summary
 boolean addAttribute(ACMetadata attribute)
          Adds the given attribute to this object class.
protected  void cleave()
          This method will cause this object class to remove any links between it and the object model to which it is currently attached.
 Set<ACMetadata> getAllAttributes()
          Return a set of all available attributes for this class (inherited included)
 ACMetadata getAttribute(int handle)
          Get the available attribute (inherited included) of this class for the given handle.
 int getAttributeHandle(String name)
          Return the handle of the contained attribute of the given name.
 String getAttributeName(int handle)
          Return the name of the contained attribute of the given handle.
 Set<OCMetadata> getChildTypes()
          Returns a set of all the direct child types of this one.
 ACMetadata getDeclaredAttribute(int handle)
          Get the locally declared attribute (not inherited) of the given handle and return it.
 Set<ACMetadata> getDeclaredAttributes()
          Return a set of all the attributes contained directly within this class (no inherited ones)
 int getHandle()
          Get the handle for this class
 String getLocalName()
          Get the local portion of the object class name.
 ObjectModel getModel()
           
 OCMetadata getParent()
          Return the parent of this object class
 String getQualifiedName()
          Return the fully-qualified name of this object class.
 String getVersionSafeQualifiedName()
          Gets the qualified name WITHOUT ObjectRoot or HLAobjectRoot prefixed at the front.
 boolean hasAttribute(int handle)
          Returns true if this class contains an attribute of the given handle.
 OCInstance newInstance()
          Creates a new instance of this type with an ACInstance for each attribute.
 ACMetadata removeAttribute(int handle)
          Remove and return the local attribute of the given handle (not inherited).
 void setModel(ObjectModel model)
           
 void setParent(OCMetadata oc)
          Set the parent of this class
 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

parent

private OCMetadata parent

attributes

private Map<Integer,ACMetadata> attributes

children

private Set<OCMetadata> children

model

private ObjectModel model

qualifiedName

private String qualifiedName

vsafeQualifiedName

private String vsafeQualifiedName
Constructor Detail

OCMetadata

public OCMetadata(String name,
                  int handle)
NOTE: This constructor should generally not be used. If you want an instance of this class you should use the creation methods of ObjectModel.

Method Detail

getChildTypes

public Set<OCMetadata> getChildTypes()
Returns a set of all the direct child types of this one.


newInstance

public OCInstance newInstance()
Creates a new instance of this type with an ACInstance for each attribute. The returned instance will not have a handle or a name.


cleave

protected void cleave()
This method will cause this object class to remove any links between it and the object model to which it is currently attached. This includes removing itself from theh store of "child" classes in its parent and setting its object model reference to null. The overall effect of this method is to cleave the object class from the object model.


addAttribute

public boolean addAttribute(ACMetadata attribute)
Adds the given attribute to this object class. If the name of the attribute is the same as one already in this class, the request will be ignored and false will be returned. Otherwise, the attribute will be added and true will be returned.


removeAttribute

public ACMetadata removeAttribute(int handle)
Remove and return the local attribute of the given handle (not inherited). If there is no attribute by that handle, null will be returned.


getDeclaredAttributes

public Set<ACMetadata> getDeclaredAttributes()
Return a set of all the attributes contained directly within this class (no inherited ones)


getAllAttributes

public Set<ACMetadata> getAllAttributes()
Return a set of all available attributes for this class (inherited included)


getDeclaredAttribute

public ACMetadata getDeclaredAttribute(int handle)
Get the locally declared attribute (not inherited) of the given handle and return it. If there is no such attribute with that handle, return null.


getAttribute

public ACMetadata getAttribute(int handle)
Get the available attribute (inherited included) of this class for the given handle. If there is none for that handle (either local or inherited), null will be returned.


getAttributeHandle

public int getAttributeHandle(String name)
Return the handle of the contained attribute of the given name. If there is no attribute of that name in this class, ObjectModel.INVALID_HANDLE will be returned. Note: The search will include inherited attributes.


getAttributeName

public String getAttributeName(int handle)
Return the name of the contained attribute of the given handle. If there is no attribute of that handle in this class, null will be returned. Note: The search will include inherited attributes.


hasAttribute

public boolean hasAttribute(int handle)
Returns true if this class contains an attribute of the given handle.


getHandle

public int getHandle()
Get the handle for this class


getLocalName

public String getLocalName()
Get the local portion of the object class name. For example, if the qualified name was "ObjectRoot.Surface.Car", the local name would be "Car". Note that the name this class should be given on creation IS its local name only (not its fully qualified version)


getQualifiedName

public String getQualifiedName()
Return the fully-qualified name of this object class. This will recurse through all the parents and generate the full name.


getVersionSafeQualifiedName

public String getVersionSafeQualifiedName()
Gets the qualified name WITHOUT ObjectRoot or HLAobjectRoot prefixed at the front. Thus, this name (while not 100% qualified) doesn't contain HLA version specific information.


getParent

public OCMetadata getParent()
Return the parent of this object class


setParent

public void setParent(OCMetadata oc)
Set the parent of this class


getModel

public ObjectModel getModel()

setModel

public void setModel(ObjectModel model)

toString

public String toString()
Overrides:
toString in class Object

copyright The Portico Project 2008.