org.npsnet.xrti
Class ObjectClassDescriptor

java.lang.Object
  extended byorg.npsnet.xrti.ObjectClassDescriptor
All Implemented Interfaces:
HLAobjectClassListener

public class ObjectClassDescriptor
extends java.lang.Object
implements HLAobjectClassListener

Describes an object class.

Author:
Andrzej Kapolka

Constructor Summary
ObjectClassDescriptor(DescriptorManager pDescriptorManager, java.lang.String pName, ObjectClassHandle pHandle, HLAobjectClass pProxy)
          Constructor.
ObjectClassDescriptor(java.lang.String pName, ObjectClassHandle pHandle, java.util.Collection pParentDescriptors)
          Constructor.
 
Method Summary
 void addAttributeDescriptor(AttributeDescriptor ad)
          Adds an attribute descriptor.
protected  void attributeAdded(AttributeDescriptor ad)
          Notifies this object that an attribute of interest has been added to the descriptor manager.
 void attributesUpdated(HLAobjectClass source, long[] oldValue, long[] newValue, byte[] userSuppliedTag, OrderType sentOrdering, TransportationType theTransport)
          Notifies the listener that the attributes attribute has been updated.
 AttributeDescriptor getAttributeDescriptor(AttributeHandle handle)
          Returns the descriptor for the attribute with the given handle.
 AttributeDescriptor getAttributeDescriptor(java.lang.String name)
          Returns the descriptor for the attribute with the given name.
 java.util.Collection getAttributeDescriptors()
          Returns an immutable collection containing the descriptors of all known attributes.
 java.util.Collection getAttributeHandles()
          Gets the handles of all attributes associated with this object class, including those of all parents.
 ObjectClassHandle getHandle()
          Returns the handle of this object class.
 java.lang.String getName()
          Returns the name of this object class.
 java.util.Collection getParentDescriptors()
          Returns the descriptors of this object class's parents.
protected  void objectClassAdded(ObjectClassDescriptor ocd)
          Notifies this object that an object class of interest has been added to the descriptor manager.
 void parentsUpdated(HLAobjectClass source, java.lang.String oldValue, java.lang.String newValue, byte[] userSuppliedTag, OrderType sentOrdering, TransportationType theTransport)
          Notifies the listener that the parents attribute has been updated.
 void removeAttributeDescriptor(AttributeDescriptor ad)
          Removes an attribute descriptor.
 void semanticsUpdated(HLAobjectClass source, java.lang.String oldValue, java.lang.String newValue, byte[] userSuppliedTag, OrderType sentOrdering, TransportationType theTransport)
          Notifies the listener that the semantics attribute has been updated.
 void sharingUpdated(HLAobjectClass source, HLAsharingType oldValue, HLAsharingType newValue, byte[] userSuppliedTag, OrderType sentOrdering, TransportationType theTransport)
          Notifies the listener that the sharing attribute has been updated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectClassDescriptor

public ObjectClassDescriptor(java.lang.String pName,
                             ObjectClassHandle pHandle,
                             java.util.Collection pParentDescriptors)
Constructor.

Parameters:
pName - the name of the object class
pHandle - the handle of the object class
pParentDescriptors - the descriptors of the object class's parents

ObjectClassDescriptor

public ObjectClassDescriptor(DescriptorManager pDescriptorManager,
                             java.lang.String pName,
                             ObjectClassHandle pHandle,
                             HLAobjectClass pProxy)
Constructor.

Parameters:
pDescriptorManager - the descriptor manager
pName - the name of the object class
pHandle - the handle of the object class
pProxy - the proxy corresponding to a remote object
Method Detail

objectClassAdded

protected void objectClassAdded(ObjectClassDescriptor ocd)
Notifies this object that an object class of interest has been added to the descriptor manager.

Parameters:
ocd - the object class descriptor

attributeAdded

protected void attributeAdded(AttributeDescriptor ad)
Notifies this object that an attribute of interest has been added to the descriptor manager.

Parameters:
ad - the attribute descriptor

getName

public java.lang.String getName()
Returns the name of this object class.

Returns:
the name of this object class

getHandle

public ObjectClassHandle getHandle()
Returns the handle of this object class.

Returns:
the handle of this object class

getParentDescriptors

public java.util.Collection getParentDescriptors()
Returns the descriptors of this object class's parents.

Returns:
the descriptors of this object class's parents

addAttributeDescriptor

public void addAttributeDescriptor(AttributeDescriptor ad)
Adds an attribute descriptor.

Parameters:
ad - the attribute descriptor to add

removeAttributeDescriptor

public void removeAttributeDescriptor(AttributeDescriptor ad)
Removes an attribute descriptor.

Parameters:
ad - the attribute descriptor to remove

getAttributeDescriptor

public AttributeDescriptor getAttributeDescriptor(java.lang.String name)
Returns the descriptor for the attribute with the given name. First searches the attributes of this class, then the attributes of the parent classes.

Parameters:
name - the name of the attribute
Returns:
the attribute descriptor, or null if no such descriptor exists

getAttributeDescriptor

public AttributeDescriptor getAttributeDescriptor(AttributeHandle handle)
Returns the descriptor for the attribute with the given handle. First searches the attributes of this class, then the attributes of the parent classes.

Parameters:
handle - the handle of the attribute
Returns:
the attribute descriptor, or null if no such descriptor exists

getAttributeDescriptors

public java.util.Collection getAttributeDescriptors()
Returns an immutable collection containing the descriptors of all known attributes. Each element of the collection will be an AttributeDescriptor.

Returns:
an immutable collection containing the descriptors of all known attributes

getAttributeHandles

public java.util.Collection getAttributeHandles()
Gets the handles of all attributes associated with this object class, including those of all parents.

Returns:
a collection containing all of this object class's attribute handles

parentsUpdated

public void parentsUpdated(HLAobjectClass source,
                           java.lang.String oldValue,
                           java.lang.String newValue,
                           byte[] userSuppliedTag,
                           OrderType sentOrdering,
                           TransportationType theTransport)
Notifies the listener that the parents attribute has been updated.

Specified by:
parentsUpdated in interface HLAobjectClassListener
Parameters:
source - the source of the notification
oldValue - the old value of the attribute
newValue - the new value of the attribute
userSuppliedTag - the user-supplied tag associated with the update
sentOrdering - the type of ordering with which the update was sent
theTransport - the type of transport associated with the update

sharingUpdated

public void sharingUpdated(HLAobjectClass source,
                           HLAsharingType oldValue,
                           HLAsharingType newValue,
                           byte[] userSuppliedTag,
                           OrderType sentOrdering,
                           TransportationType theTransport)
Notifies the listener that the sharing attribute has been updated.

Specified by:
sharingUpdated in interface HLAobjectClassListener
Parameters:
source - the source of the notification
oldValue - the old value of the attribute
newValue - the new value of the attribute
userSuppliedTag - the user-supplied tag associated with the update
sentOrdering - the type of ordering with which the update was sent
theTransport - the type of transport associated with the update

attributesUpdated

public void attributesUpdated(HLAobjectClass source,
                              long[] oldValue,
                              long[] newValue,
                              byte[] userSuppliedTag,
                              OrderType sentOrdering,
                              TransportationType theTransport)
Notifies the listener that the attributes attribute has been updated.

Specified by:
attributesUpdated in interface HLAobjectClassListener
Parameters:
source - the source of the notification
oldValue - the old value of the attribute
newValue - the new value of the attribute
userSuppliedTag - the user-supplied tag associated with the update
sentOrdering - the type of ordering with which the update was sent
theTransport - the type of transport associated with the update

semanticsUpdated

public void semanticsUpdated(HLAobjectClass source,
                             java.lang.String oldValue,
                             java.lang.String newValue,
                             byte[] userSuppliedTag,
                             OrderType sentOrdering,
                             TransportationType theTransport)
Notifies the listener that the semantics attribute has been updated.

Specified by:
semanticsUpdated in interface HLAobjectClassListener
Parameters:
source - the source of the notification
oldValue - the old value of the attribute
newValue - the new value of the attribute
userSuppliedTag - the user-supplied tag associated with the update
sentOrdering - the type of ordering with which the update was sent
theTransport - the type of transport associated with the update