jp.go.aist.rtm.RTC
Class ObjectManager<IDENTIFIER,TARGET>

java.lang.Object
  extended by jp.go.aist.rtm.RTC.ObjectManager<IDENTIFIER,TARGET>
Type Parameters:
IDENTIFIER - The data type of the object flag is specified.
TARGET - The type of the object to be managed is specified.

public class ObjectManager<IDENTIFIER,TARGET>
extends java.lang.Object

Class for managing objects

This is a class for managing various objects.


Field Summary
protected  java.util.Vector<TARGET> m_objects
           The list of registered objects
 
Constructor Summary
ObjectManager()
           
 
Method Summary
 TARGET find(equalFunctor equalFunc)
           Find the object
 java.util.Vector<TARGET> getObjects()
           Get a list of obejects that are registerd
 boolean registerObject(TARGET obj, equalFunctor equalFunc)
           Register the specified object
 TARGET unregisterObject(equalFunctor equalFunc)
           Unregister the specified object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_objects

protected java.util.Vector<TARGET> m_objects
The list of registered objects

Constructor Detail

ObjectManager

public ObjectManager()
Method Detail

registerObject

public boolean registerObject(TARGET obj,
                              equalFunctor equalFunc)
Register the specified object

Register the object that was specified. If the same object is already registered, this does not anything.

Parameters:
obj - The target object for the registration
equalFunc - The Object used for the same judgment.
Returns:
Registration result (True if object was registerd)

unregisterObject

public TARGET unregisterObject(equalFunctor equalFunc)
Unregister the specified object

Unregister the object that was specified and get it. This operation returns NULL if the specified object is not registered.

Parameters:
equalFunc - The object of the target object for the unregistration
Returns:
Unregistered object. Returns NULL if the specified object is not registered.

find

public TARGET find(equalFunctor equalFunc)
Find the object

Find the object that matches the specified condition among the registered objects and get it. This operation returns NULL if the object that does matches the specified condition is not registered.

Parameters:
equalFunc - The object of the target object for finding
Returns:
Result of finding object

getObjects

public java.util.Vector<TARGET> getObjects()
Get a list of obejects that are registerd

Returns:
List of registerd objects.