|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.virtuosotechnologies.lib.container.PseudoModifiableObjectDeque
An ObjectDeque that implements methods of ModifiableObjectDeque without implementing the ModifiableObjectDeque interface. This is useful for implementations that don't want to export objects that appear to be modifiable.
This implementation is fully synchronized and thread-safe. However, note that it may be used in larger implementations that are not thread-safe.
Constructor Summary | |
PseudoModifiableObjectDeque()
Constructor with no constraints |
|
PseudoModifiableObjectDeque(ConstrainedKey constraints)
Constructor |
Method Summary | |
void |
addObjectDequeListener(ObjectDequeListener listener)
Add an ObjectDequeListener. |
Object |
getBack()
Get the object in back of the deque. |
ConstrainedKey |
getConstraints()
Get the constraints for the container contents. |
Object[] |
getContentsAsArray(Class cls)
Atomically get the current contents of the container as an array. |
Object |
getFront()
Get the object in front of the deque. |
Object |
getNthObject(int n)
Get the indexed object. |
int |
getSize()
Get the size of the container. |
void |
insertObject(int n,
Object obj)
Insert an object in the deque at a particular index. |
Object |
popObjectBack()
Pop an object from the back of the deque. |
Object |
popObjectFront()
Pop an object from the front of the deque. |
void |
pushObjectBack(Object obj)
Push an object on the back of the deque. |
void |
pushObjectFront(Object obj)
Push an object on the front of the deque. |
Object |
removeObject(int n)
Remove an object from the middle of the deque. |
void |
removeObjectDequeListener(ObjectDequeListener listener)
Remove an ObjectDequeListener. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PseudoModifiableObjectDeque()
public PseudoModifiableObjectDeque(ConstrainedKey constraints)
constraints
- constraints for the set, or null for no constraints.Method Detail |
public final ConstrainedKey getConstraints()
getConstraints
in interface ObjectContainer
public int getSize()
getSize
in interface ObjectContainer
public Object[] getContentsAsArray(Class cls)
getContentsAsArray
in interface ObjectContainer
cls
- a class representing the element type
public Object getFront()
getFront
in interface ObjectDeque
public Object getBack()
getBack
in interface ObjectDeque
public Object getNthObject(int n)
getNthObject
in interface ObjectDeque
n
- index.
IndexOutOfBoundsException
- index out of boundspublic final void addObjectDequeListener(ObjectDequeListener listener)
addObjectDequeListener
in interface ObjectDeque
listener
- new listenerpublic final void removeObjectDequeListener(ObjectDequeListener listener)
removeObjectDequeListener
in interface ObjectDeque
listener
- listener to removepublic void pushObjectFront(Object obj)
obj
- object to push
ConstraintsMismatchException
- obj doesn't obey the constraintspublic void pushObjectBack(Object obj)
obj
- object to push
ConstraintsMismatchException
- obj doesn't obey the constraintspublic void insertObject(int n, Object obj)
n
- index to insert atobj
- object to insert
ConstraintsMismatchException
- obj doesn't obey the constraints
IndexOutOfBoundsException
- index out of boundspublic Object popObjectFront()
public Object popObjectBack()
public Object removeObject(int n)
n
- index to remove
IndexOutOfBoundsException
- index out of bounds
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |