|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.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 Storagepublic 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 Storagejava.lang.IllegalArgumentException
java.lang.ArrayStoreException
public java.lang.Object setAt(int location,
java.lang.Object value)
throws java.lang.IllegalArgumentException
setAt in class Storagejava.lang.IllegalArgumentExceptionpublic final java.lang.Object getAt(int location)
getAt in class Storagepublic 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 Storagejava.lang.IllegalArgumentException
public int siblingLocation(int location,
boolean forward)
throws java.lang.IllegalArgumentException
Storage
siblingLocation in class Storagejava.lang.IllegalArgumentException
public int parentLocation(int location)
throws java.lang.IllegalArgumentException
Storage
parentLocation in class Storagejava.lang.IllegalArgumentException
public int locationOf(java.lang.Object value,
int prevLocation,
boolean forward)
throws java.lang.IllegalArgumentException
locationOf in class Storagejava.lang.IllegalArgumentException
public int findLessGreater(java.lang.Object value,
boolean greater,
int prevLocation,
boolean forward)
throws java.lang.IllegalArgumentException
findLessGreater in class Storagejava.lang.IllegalArgumentExceptionpublic java.lang.Object clone()
clone in interface ReallyCloneableclone in class Storagenull) of this instance.public void integrityCheck()
integrityCheck in interface VerifiableintegrityCheck in class Storage
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||