|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.erights.e.elib.tables.Column
|
+--org.erights.e.elib.tables.KeyColumn
|
+--org.erights.e.elib.tables.IdentityKeyColumn
| Field Summary | |
(package private) static int |
KEY_DELETED
A value in myPos2Rank indicating that this position used to be occupied since the last rehash, but no longer is. |
(package private) static int |
KEY_UNUSED
A value in myPos2Rank indicating that this position has never been occupied since the last rehash. |
(package private) Object[] |
myKeys
The sparse array of keys by position. |
private int |
myMaxProbes
The maximum number of probes made so far. |
(package private) int |
myNumDeleted
The number of keys currently marked deleted in the column. |
(package private) int |
myNumTaken
The number of key currently in the column. |
(package private) int[] |
myPos2Rank
A sparse array parallel to myKeys. |
(package private) int[] |
myRank2Pos
A dense array, listing positions in their enumeration order. |
static int |
POSITIVE_MASK
Used to ensure ints are positive |
| Constructor Summary | |
|
IdentityKeyColumn()
Reasonable defaults |
|
IdentityKeyColumn(Class memberType)
Reasonable defaults |
|
IdentityKeyColumn(Class memberType,
int capacity)
|
|
IdentityKeyColumn(int capacity)
Reasonable defaults |
private |
IdentityKeyColumn(Object[] keys,
int[] pos2Rank,
int[] rank2Pos,
int numTaken,
int numDeleted,
int maxProbes)
|
| Method Summary | |
(package private) int |
capacity()
|
protected Object |
clone()
Argument defaults to memberType() |
protected Column |
diverge(Class membType)
A shallow copy of the column. |
(package private) int |
findPosOf(Object key)
Returns the pos at which key resides, or -1 if the key is absent from the map. |
(package private) Object |
get(int pos)
|
(package private) boolean |
isPosTaken(int pos)
Given a pos, say whether this pos contains a valid key. |
(package private) static KeyColumn |
make(Class memberType,
int capacity)
Makes a key column that's equivalent to a SamenessKeyColumn(memberType, capacity), but may select a more efficient implementation based on how instances of memberType compare for sameness. |
(package private) Class |
memberType()
All the members of the column must conform to this type |
(package private) Column |
newVacant(int capacity)
Makes a new column just like this one, except of the specified size and without any members. |
(package private) int |
numTaken()
Get the number of keys in the column |
(package private) int |
occupy(int pos,
Object key)
|
(package private) void |
put(int pos,
Object value)
|
(package private) int[] |
rank2Pos()
Caller should only read, and only between 0..!numTaken() |
(package private) static int |
skip(int hash,
int len)
|
(package private) int |
store(Object key)
Put the given key into the map, and return its pos. |
(package private) void |
vacate(int pos)
cause pos not to contain a valid key |
static Column |
values(Class memberType,
int capacity)
Make a value-column that can only hold values that conform to 'memberType' and has 'capacity' positions. |
static Column |
values(int capacity)
memberType defaults to Object |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private final int myMaxProbes
public static final int POSITIVE_MASK
final Object[] myKeys
final int[] myPos2Rank
static final int KEY_UNUSED
static final int KEY_DELETED
final int[] myRank2Pos
int myNumTaken
int myNumDeleted
| Constructor Detail |
public IdentityKeyColumn()
private IdentityKeyColumn(Object[] keys,
int[] pos2Rank,
int[] rank2Pos,
int numTaken,
int numDeleted,
int maxProbes)
public IdentityKeyColumn(int capacity)
public IdentityKeyColumn(Class memberType)
public IdentityKeyColumn(Class memberType,
int capacity)
| Method Detail |
protected Column diverge(Class membType)
Column
diverge in class ColumnColumn newVacant(int capacity)
Column
newVacant in class Columnint findPosOf(Object key)
KeyColumn
findPosOf in class KeyColumnint store(Object key)
KeyColumnIf the key already exists, no ordering information is affected. If a novel key is inserted, it's position gets the next rank.
store in class KeyColumnkey - the key to place in the map
static KeyColumn make(Class memberType,
int capacity)
Object get(int pos)
get in class Columnboolean isPosTaken(int pos)
Class memberType()
Column
memberType in class Columnint capacity()
capacity in class Columnint numTaken()
int[] rank2Pos()
void put(int pos,
Object value)
put in class Column
static int skip(int hash,
int len)
int occupy(int pos,
Object key)
void vacate(int pos)
vacate in class Columnprotected Object clone()
clone in class Objectjava.lang.Cloneablepublic static Column values(int capacity)
public static Column values(Class memberType,
int capacity)
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||