public abstract class BMapJid<KEY_TYPE extends Comparable<KEY_TYPE>,VALUE_TYPE extends Jid> extends AppJid implements Collection<MapEntry<KEY_TYPE,VALUE_TYPE>>, JAList, JAMap<KEY_TYPE,VALUE_TYPE>
Modifier and Type | Field and Description |
---|---|
protected boolean |
isRoot |
protected int |
nodeCapacity |
protected int |
TUPLE_SIZE |
protected int |
TUPLE_UNION |
org.agilewiki.jactor.factory.ActorFactory |
valueFactory |
tuple, tupleFactories
serializedBytes, serializedOffset
Constructor and Description |
---|
BMapJid() |
Modifier and Type | Method and Description |
---|---|
void |
empty() |
MapEntry<KEY_TYPE,VALUE_TYPE> |
getCeiling(KEY_TYPE key)
Returns the JID value with the smallest key >= the given key.
|
MapEntry<KEY_TYPE,VALUE_TYPE> |
getFirst() |
MapEntry<KEY_TYPE,VALUE_TYPE> |
getHigher(KEY_TYPE key)
Returns the JID value with a greater key.
|
MapEntry<KEY_TYPE,VALUE_TYPE> |
getLast() |
KEY_TYPE |
getLastKey() |
protected MapJid<KEY_TYPE,Jid> |
getNode() |
String |
getNodeType() |
protected IntegerJid |
getSizeJid() |
protected UnionJid |
getUnionJid() |
protected abstract org.agilewiki.jactor.factory.ActorFactory |
getUnionJidFactory() |
protected org.agilewiki.jactor.factory.ActorFactory |
getValueFactory() |
void |
iAdd(int i) |
void |
iAddBytes(int ndx,
byte[] bytes) |
MapEntry<KEY_TYPE,VALUE_TYPE> |
iGet(int ndx)
Returns the selected element.
|
protected void |
incSize(int inc) |
protected void |
init() |
protected void |
inodeSplit(MapEntry<KEY_TYPE,BMapJid<KEY_TYPE,Jid>> leftEntry) |
void |
iRemove(int ndx) |
void |
iSetBytes(int ndx,
byte[] bytes)
Creates a JID actor and loads its serialized data.
|
boolean |
isFat() |
boolean |
isLeaf() |
VALUE_TYPE |
kGet(KEY_TYPE key)
Returns the JID value associated with the key.
|
MapEntry<KEY_TYPE,VALUE_TYPE> |
kGetEntry(KEY_TYPE key) |
Boolean |
kMake(KEY_TYPE key)
Add an entry to the map unless there is an entry with a matching first element.
|
Boolean |
kMakeBytes(KEY_TYPE key,
byte[] bytes)
Add a tuple to the map unless there is a tuple with a matching first element.
|
boolean |
kRemove(KEY_TYPE key)
Removes the item identified by the key.
|
void |
kSetBytes(KEY_TYPE key,
byte[] bytes) |
int |
nodeSize() |
_Jid |
resolvePathname(String pathname)
Resolves a JID pathname, returning a JID actor or null.
|
protected void |
rootSplit() |
protected void |
setNodeType(String nodeType) |
int |
size()
Returns the size of the collection.
|
protected abstract KEY_TYPE |
stringToKey(String skey)
Converts a string to a key.
|
_iGet, _iSetBytes, _resolvePathname, _size, change, getSerializedLength, getTupleFactories, load, serialize
changed, copyJID, createSubordinate, createSubordinate, createSubordinate, createSubordinate, createSubordinate, createSubordinate, createSubordinate, createSubordinate, createSubordinate, createSubordinate, createSubordinate, createSubordinate, getSerializedBytes, isJidEqual, isSerialized, readable, save, setContainerJid
acceptEvent, acceptRequest, getActorType, getAncestor, getExceptionHandler, getFactory, getMailbox, getMailboxFactory, getMatch, getParent, hasDataItem, haveEvents, initialize, initialize, initialize, initialize, initialize, requirements, responseFrom, send, send, sendEvent, setExceptionHandler, setInitialBufferCapacity
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
change, getSerializedLength, load, save, setContainerJid
protected final int TUPLE_SIZE
protected final int TUPLE_UNION
protected int nodeCapacity
protected boolean isRoot
public org.agilewiki.jactor.factory.ActorFactory valueFactory
protected abstract org.agilewiki.jactor.factory.ActorFactory getUnionJidFactory() throws Exception
Exception
protected abstract KEY_TYPE stringToKey(String skey)
skey
- The string to be converted.protected org.agilewiki.jactor.factory.ActorFactory getValueFactory() throws Exception
Exception
protected IntegerJid getSizeJid() throws Exception
Exception
public int size() throws Exception
size
in interface Collection<MapEntry<KEY_TYPE extends Comparable<KEY_TYPE>,VALUE_TYPE extends Jid>>
size
in interface JAMap<KEY_TYPE extends Comparable<KEY_TYPE>,VALUE_TYPE extends Jid>
Exception
public MapEntry<KEY_TYPE,VALUE_TYPE> iGet(int ndx) throws Exception
iGet
in interface Collection<MapEntry<KEY_TYPE extends Comparable<KEY_TYPE>,VALUE_TYPE extends Jid>>
ndx
- Selects the element.Exception
public void iSetBytes(int ndx, byte[] bytes) throws Exception
iSetBytes
in interface Collection<MapEntry<KEY_TYPE extends Comparable<KEY_TYPE>,VALUE_TYPE extends Jid>>
ndx
- The index of the desired element.bytes
- Holds the serialized data.Exception
- Any exceptions thrown while processing the request.public void iAdd(int i) throws Exception
public void iAddBytes(int ndx, byte[] bytes) throws Exception
public Boolean kMakeBytes(KEY_TYPE key, byte[] bytes) throws Exception
kMakeBytes
in interface JAMap<KEY_TYPE extends Comparable<KEY_TYPE>,VALUE_TYPE extends Jid>
key
- Used to match the first element of the tuples.bytes
- The serialized form of a JID of the appropriate type.Exception
public final Boolean kMake(KEY_TYPE key) throws Exception
kMake
in interface JAMap<KEY_TYPE extends Comparable<KEY_TYPE>,VALUE_TYPE extends Jid>
key
- Used to match the first element of the entries.Exception
protected void inodeSplit(MapEntry<KEY_TYPE,BMapJid<KEY_TYPE,Jid>> leftEntry) throws Exception
Exception
public void empty() throws Exception
public void iRemove(int ndx) throws Exception
public final boolean kRemove(KEY_TYPE key) throws Exception
kRemove
in interface JAMap<KEY_TYPE extends Comparable<KEY_TYPE>,VALUE_TYPE extends Jid>
key
- The key.Exception
public final MapEntry<KEY_TYPE,VALUE_TYPE> kGetEntry(KEY_TYPE key) throws Exception
Exception
public final VALUE_TYPE kGet(KEY_TYPE key) throws Exception
kGet
in interface JAMap<KEY_TYPE extends Comparable<KEY_TYPE>,VALUE_TYPE extends Jid>
key
- The key.Exception
public final MapEntry<KEY_TYPE,VALUE_TYPE> getCeiling(KEY_TYPE key) throws Exception
getCeiling
in interface JAMap<KEY_TYPE extends Comparable<KEY_TYPE>,VALUE_TYPE extends Jid>
key
- The key.Exception
public final MapEntry<KEY_TYPE,VALUE_TYPE> getHigher(KEY_TYPE key) throws Exception
getHigher
in interface JAMap<KEY_TYPE extends Comparable<KEY_TYPE>,VALUE_TYPE extends Jid>
key
- The key.Exception
public final _Jid resolvePathname(String pathname) throws Exception
resolvePathname
in interface _Jid
resolvePathname
in class Jid
pathname
- A JID pathname.Exception
- Any uncaught exception which occurred while processing the request.public MapEntry<KEY_TYPE,VALUE_TYPE> getFirst() throws Exception
getFirst
in interface JAMap<KEY_TYPE extends Comparable<KEY_TYPE>,VALUE_TYPE extends Jid>
Exception
public MapEntry<KEY_TYPE,VALUE_TYPE> getLast() throws Exception
getLast
in interface JAMap<KEY_TYPE extends Comparable<KEY_TYPE>,VALUE_TYPE extends Jid>
Exception
public void kSetBytes(KEY_TYPE key, byte[] bytes) throws Exception
kSetBytes
in interface JAMap<KEY_TYPE extends Comparable<KEY_TYPE>,VALUE_TYPE extends Jid>
Exception
Copyright © 2013. All Rights Reserved.