|
|||||||||
| 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
net.sf.ivmaidns.storage.HashedStorage
public class HashedStorage
Class for storage of hashed elements.
| Field Summary | |
|---|---|
protected int[] |
links
NOTE: links must be ! |
protected int |
size
NOTE: size must be the number of elements in the storage. |
| Fields inherited from class net.sf.ivmaidns.storage.ObjectStorage |
|---|
elements |
| Constructor Summary | |
|---|---|
HashedStorage()
|
|
HashedStorage(java.lang.Object[] initialValues)
NOTE: initialValues must be ! |
|
| Method Summary | |
|---|---|
protected static int |
addressOf(int hash,
int location,
int[] links)
NOTE: location must be > 0. |
java.lang.Object |
clone()
NOTE: Must be synchronized outside. |
int |
emptyLocation()
NOTE: Result is an empty location (result > 0). |
void |
integrityCheck()
NOTE: Shallow check for integrity of this object. |
int |
locationOf(java.lang.Object value,
int prevLocation,
boolean forward)
NOTE: value is compared against elements. |
protected void |
minimizeCapacity()
NOTE: Must be synchronized outside. |
protected static void |
randomize(int[] links,
int count)
NOTE: Called internally only just before rehashing or if size == 0. |
void |
rehash()
NOTE: The effectiveness is nearly linear. |
java.lang.Object |
setAt(int location,
java.lang.Object value)
NOTE: No equals checking is performed here. |
int |
size()
NOTE: Result is the count of elements. |
| Methods inherited from class net.sf.ivmaidns.storage.ObjectStorage |
|---|
childLocation, findLessGreater, getAt, insertAt, isValidAt, parentLocation, siblingLocation |
| 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 int[] links
protected transient int size
| Constructor Detail |
|---|
public HashedStorage()
public HashedStorage(java.lang.Object[] initialValues)
throws java.lang.NullPointerException
java.lang.NullPointerException| Method Detail |
|---|
public final int size()
protected void minimizeCapacity()
minimizeCapacity in class ObjectStoragepublic void rehash()
protected static final void randomize(int[] links,
int count)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException
java.lang.NullPointerException
java.lang.ArrayIndexOutOfBoundsException
protected static final int addressOf(int hash,
int location,
int[] links)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException
java.lang.NullPointerException
java.lang.ArrayIndexOutOfBoundsExceptionpublic final int emptyLocation()
Storage
emptyLocation in class ObjectStorage
public java.lang.Object setAt(int location,
java.lang.Object value)
throws java.lang.IllegalArgumentException
setAt in class ObjectStoragejava.lang.IllegalArgumentException
public int locationOf(java.lang.Object value,
int prevLocation,
boolean forward)
throws java.lang.IllegalArgumentException
locationOf in class ObjectStoragejava.lang.IllegalArgumentExceptionpublic java.lang.Object clone()
clone in interface ReallyCloneableclone in class ObjectStoragenull) of this instance.public void integrityCheck()
integrityCheck in interface VerifiableintegrityCheck in class ObjectStorage
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||