uka.transport
Class DefaultObjectSpace

java.lang.Object
  extended byuka.util.IDConstants
      extended byuka.util.IDMap
          extended byuka.transport.DefaultObjectSpace
All Implemented Interfaces:
ObjectSpace, Printable, java.io.Serializable
Direct Known Subclasses:
DefaultSharedObjectSpace

public class DefaultObjectSpace
extends IDMap
implements ObjectSpace

See Also:
Serialized Form

Field Summary
 
Fields inherited from class uka.util.IDMap
idToObject, INVALID_INDEX, space
 
Fields inherited from class uka.util.IDConstants
FIRST_NEW_ID, FIRST_VALID_ID, INVALID_ID, UNUSED_ID
 
Constructor Summary
DefaultObjectSpace()
           
 
Method Summary
 int getID(java.lang.Object obj)
          Returns the identifier for a given object.
 void includeID(int id)
          Make the object that corresponds to the given identifier part of this object space.
 boolean isAccepted(int id)
          Decides whether an object reference should be blocked during transmission through a MarshalStream/UnmarshalStream pair.
 boolean isIncluded(int id)
          Decides whether the obect that corresponds to the given identifier is part of this object space.
 boolean isShared(int id)
           
 
Methods inherited from class uka.util.IDMap
appendTo, clear, dump, findID, get, getHash, getIndexForHash, getIndexForID, getObject, getObjects, getSize, getUsedIDs, isUsed, rawFindID, remove, resetObject, restoreBeforeReadObject, set, setObject
 
Methods inherited from class uka.util.IDConstants
isNew, isValid, normalizeID, toggleNew
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uka.transport.ObjectSpace
clear, findID, getObject, getUsedIDs, isUsed, remove, resetObject, setObject
 

Constructor Detail

DefaultObjectSpace

public DefaultObjectSpace()
Method Detail

includeID

public void includeID(int id)
Description copied from interface: ObjectSpace
Make the object that corresponds to the given identifier part of this object space. An object is part of an object space, if the ObjectSpace.isIncluded(int) method returns true for the corresponding identifier. An object can have an assigned identifier in some object space without being part of that object space.

Specified by:
includeID in interface ObjectSpace
Returns:
the identifier assigned to the object passed as parameter.

getID

public int getID(java.lang.Object obj)
Description copied from interface: ObjectSpace
Returns the identifier for a given object. If the object was presented to the ObjectSpace the first time, the #isNew method returns true for the resulting identifier.

Specified by:
getID in interface ObjectSpace
Overrides:
getID in class IDMap

isIncluded

public boolean isIncluded(int id)
Description copied from interface: ObjectSpace
Decides whether the obect that corresponds to the given identifier is part of this object space.

Specified by:
isIncluded in interface ObjectSpace
Returns:
whether the object that corresponds to the given identifier is part of this object space.
See Also:
ObjectSpace.includeID(int)

isShared

public boolean isShared(int id)
Specified by:
isShared in interface ObjectSpace
Returns:
whether the object that corresponds to the given identifier is a shared object.

isAccepted

public boolean isAccepted(int id)
Description copied from interface: ObjectSpace
Decides whether an object reference should be blocked during transmission through a MarshalStream/UnmarshalStream pair. If a call to ObjectSpace.isAccepted(int) on the ObjectSpace of the sender-side stream returns false for an object identifier, a reference to the corresponding object is blocked (replaced with null).

Specified by:
isAccepted in interface ObjectSpace
Returns:
whether references to the corresponding object should be marshaled or blocked.