|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.ivmaidns.util.ObservedCore net.sf.ivmaidns.storage.Storage net.sf.ivmaidns.storage.ObjectStorage
public class ObjectStorage
Class for simple array-like storage.
Field Summary | |
---|---|
protected java.lang.Object[] |
elements
NOTE: elements must be ! |
Constructor Summary | |
---|---|
ObjectStorage()
|
Method Summary | |
---|---|
int |
childLocation(int parentLocation,
boolean forward)
NOTE: If parentLocation ! |
java.lang.Object |
clone()
NOTE: Must be synchronized outside. |
int |
emptyLocation()
NOTE: Result is an empty location (result > 0). |
int |
findLessGreater(java.lang.Object value,
boolean greater,
int prevLocation,
boolean forward)
NOTE: If value == null then 0 is returned. |
java.lang.Object |
getAt(int location)
NOTE: All non-empty locations are valid. |
int |
insertAt(int prevLoc,
int emptyLocation,
java.lang.Object value)
NOTE: prevLoc must be >= 0 and insertion after prevLoc must be possible in this storage (according to the semantics of array), otherwise ArrayStoreException is thrown. |
void |
integrityCheck()
NOTE: Shallow check for integrity of this object. |
boolean |
isValidAt(int location)
NOTE: Result is true if and only if location is "valid" (only not "empty" locations may be "valid"). |
int |
locationOf(java.lang.Object value,
int prevLocation,
boolean forward)
NOTE: If value == null then 0 is returned. value is tested for equality against elements. |
protected void |
minimizeCapacity()
NOTE: The effectiveness is linear. |
int |
parentLocation(int location)
NOTE: If location is "empty" then IllegalArgumentException is thrown. |
java.lang.Object |
setAt(int location,
java.lang.Object value)
NOTE: The effectiveness is constant. |
int |
siblingLocation(int location,
boolean forward)
NOTE: If location is "empty" then IllegalArgumentException is thrown. |
Methods inherited from class net.sf.ivmaidns.storage.Storage |
---|
add, addAll, addAll, clear, contains, containsAll, containsAll, containsCount, equals, greaterThan, hasChildren, hashCode, insertAtAll, insertAtAll, nextLocation, notifyObservers, notifyObservers, remove, removeAll, removeAll, removeAt, toArray, toInlineString, toOutlineString, toString, trimToSize |
Methods inherited from class net.sf.ivmaidns.util.ObservedCore |
---|
addObserver, hasObservers, removeObserver |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected transient java.lang.Object[] elements
Constructor Detail |
---|
public ObjectStorage()
Method Detail |
---|
protected void minimizeCapacity()
minimizeCapacity
in class Storage
public int emptyLocation()
Storage
emptyLocation
in class Storage
public int insertAt(int prevLoc, int emptyLocation, java.lang.Object value) throws java.lang.IllegalArgumentException, java.lang.ArrayStoreException
insertAt
in class Storage
java.lang.IllegalArgumentException
java.lang.ArrayStoreException
public java.lang.Object setAt(int location, java.lang.Object value) throws java.lang.IllegalArgumentException
setAt
in class Storage
java.lang.IllegalArgumentException
public final java.lang.Object getAt(int location)
getAt
in class Storage
public final boolean isValidAt(int location)
Storage
isValidAt
in class Storage
public int childLocation(int parentLocation, boolean forward) throws java.lang.IllegalArgumentException
Storage
childLocation
in class Storage
java.lang.IllegalArgumentException
public int siblingLocation(int location, boolean forward) throws java.lang.IllegalArgumentException
Storage
siblingLocation
in class Storage
java.lang.IllegalArgumentException
public int parentLocation(int location) throws java.lang.IllegalArgumentException
Storage
parentLocation
in class Storage
java.lang.IllegalArgumentException
public int locationOf(java.lang.Object value, int prevLocation, boolean forward) throws java.lang.IllegalArgumentException
locationOf
in class Storage
java.lang.IllegalArgumentException
public int findLessGreater(java.lang.Object value, boolean greater, int prevLocation, boolean forward) throws java.lang.IllegalArgumentException
findLessGreater
in class Storage
java.lang.IllegalArgumentException
public java.lang.Object clone()
clone
in interface ReallyCloneable
clone
in class Storage
null
) of this
instance.public void integrityCheck()
integrityCheck
in interface Verifiable
integrityCheck
in class Storage
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |