|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuka.util.IDConstants
uka.transport.SimpleObjectSpace
| Field Summary | |
private EnlargingArray |
objects
|
(package private) int |
rewriteFirstID
|
(package private) int |
rewriteOffset
|
| Fields inherited from class uka.util.IDConstants |
FIRST_NEW_ID, FIRST_VALID_ID, INVALID_ID, UNUSED_ID |
| Constructor Summary | |
SimpleObjectSpace()
|
|
| Method Summary | |
void |
appendTo(ToString s)
This method should append the contents of each instance variable of the current
object to the given ToString object. |
void |
beginRewrite(int rewriteFirstID,
int rewriteOffset)
|
void |
clear()
Clears the object space by removing all identifier assignments. |
void |
endRewrite()
|
int |
findID(java.lang.Object obj)
Same as getID(java.lang.Object), but does not assign the object to this
object space, if the object was not yet a member. |
int |
getID(java.lang.Object obj)
Returns the identifier for a given object. |
java.lang.Object |
getObject(int id)
Finds the object for a given identifier. |
IntIterator |
getUsedIDs()
|
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)
|
boolean |
isUsed(int id)
Checks whether this object space has an object assigned to the given identifier. |
void |
remove(int id)
Removes the given identifer from this object space. |
void |
resetObject(int id,
java.lang.Object obj)
Reassigns a new object to an existing identifier. |
private int |
rewriteIncomming(int id)
|
private int |
rewriteOutgoing(int id)
|
void |
setObject(int id,
java.lang.Object obj)
Assigns the given object to an application provided identifier and includes the given object to this object
space. |
| 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 |
| Field Detail |
private final EnlargingArray objects
int rewriteFirstID
int rewriteOffset
| Constructor Detail |
public SimpleObjectSpace()
| Method Detail |
private int rewriteIncomming(int id)
private int rewriteOutgoing(int id)
public void beginRewrite(int rewriteFirstID,
int rewriteOffset)
public void endRewrite()
public IntIterator getUsedIDs()
getUsedIDs in interface ObjectSpacepublic void includeID(int id)
ObjectSpaceObjectSpace.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.
includeID in interface ObjectSpacepublic boolean isIncluded(int id)
ObjectSpace
isIncluded in interface ObjectSpaceObjectSpace.includeID(int)
public void setObject(int id,
java.lang.Object obj)
ObjectSpaceincludes the given object to this object
space.
setObject in interface ObjectSpace
public void resetObject(int id,
java.lang.Object obj)
ObjectSpaceremoving the identifier first and
then reassigning it with ObjectSpace.setObject(int, java.lang.Object). Since
ObjectSpace.setObject(int, java.lang.Object) may be overridden in subclasses to handle
the first assignment of an identifier especially, ObjectSpace.resetObject(int, java.lang.Object) can be used to avoid additional calls to ObjectSpace.setObject(int, java.lang.Object).
resetObject in interface ObjectSpacepublic java.lang.Object getObject(int id)
ObjectSpace
getObject in interface ObjectSpaceObjectSpace.getID(java.lang.Object) call that
returned the given identifier.public int getID(java.lang.Object obj)
ObjectSpaceObjectSpace the first time, the #isNew method returns true for the resulting
identifier.
getID in interface ObjectSpacepublic int findID(java.lang.Object obj)
ObjectSpaceObjectSpace.getID(java.lang.Object), but does not assign the object to this
object space, if the object was not yet a member.
findID in interface ObjectSpacepublic boolean isUsed(int id)
ObjectSpaceObjectSpace.isUsed(int) returns true
for identifier returned from ObjectSpace.getID(java.lang.Object).
isUsed in interface ObjectSpacepublic boolean isShared(int id)
isShared in interface ObjectSpacepublic boolean isAccepted(int id)
ObjectSpaceMarshalStream/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).
isAccepted in interface ObjectSpacepublic void remove(int id)
ObjectSpaceObjectSpace.getID(java.lang.Object) with the object corresponding to the given
identifier as argument will result in a new
identifier.
remove in interface ObjectSpacepublic void clear()
ObjectSpace
clear in interface ObjectSpacepublic void appendTo(ToString s)
Printableappend the contents of each instance variable of the current
object to the given ToString object. The appended data
should be labeled with the name of the corresponding instance
variable.
appendTo in interface PrintableToString,
ToString.append(String, Object),
ToString.append(String, boolean),
ToString.append(String, byte),
ToString.append(String, int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||