public abstract class MapJid<KEY_TYPE extends Comparable<KEY_TYPE>,VALUE_TYPE extends Jid> extends ListJid<MapEntry<KEY_TYPE,VALUE_TYPE>> implements JAMap<KEY_TYPE,VALUE_TYPE>, Collection<MapEntry<KEY_TYPE,VALUE_TYPE>>
Modifier and Type | Field and Description |
---|---|
org.agilewiki.jactor.factory.ActorFactory |
valueFactory |
entryFactory, initialCapacity, list
len
serializedBytes, serializedOffset
Constructor and Description |
---|
MapJid() |
Modifier and Type | Method and Description |
---|---|
int |
ceiling(KEY_TYPE key)
Locate the entry with the first element >= a key.
|
MapEntry<KEY_TYPE,VALUE_TYPE> |
getCeiling(KEY_TYPE key)
Returns the JID value with the smallest key >= the given key.
|
protected org.agilewiki.jactor.factory.ActorFactory |
getEntryFactory()
Returns the actor type of all the elements in the list.
|
MapEntry<KEY_TYPE,VALUE_TYPE> |
getFirst() |
MapEntry<KEY_TYPE,VALUE_TYPE> |
getHigher(KEY_TYPE key)
Returns the JID value with a greater key.
|
protected abstract org.agilewiki.jactor.factory.ActorFactory |
getKeyFactory()
Returns the JidFactory for the key.
|
MapEntry<KEY_TYPE,VALUE_TYPE> |
getLast() |
KEY_TYPE |
getLastKey() |
protected org.agilewiki.jactor.factory.ActorFactory |
getValueFactory()
Returns the JidFactory for the values in the map.
|
int |
higher(KEY_TYPE key)
Locate the entry with a higher key.
|
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 |
match(KEY_TYPE key)
Locate the entry with the first element >= a key, or the last entry.
|
_Jid |
resolvePathname(String pathname)
Resolves a JID pathname, returning a JID actor or null.
|
int |
search(KEY_TYPE key)
Locate the entry with a matching first element.
|
protected abstract KEY_TYPE |
stringToKey(String skey)
Converts a string to a key.
|
empty, getSerializedLength, iAdd, iAddBytes, iGet, initializeList, iRemove, iSetBytes, load, serialize, size
change, loadLen, saveLen, skipLen
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
iGet, iSetBytes, size
change, getSerializedLength, load, save, setContainerJid
protected abstract org.agilewiki.jactor.factory.ActorFactory getKeyFactory()
protected abstract KEY_TYPE stringToKey(String skey)
skey
- The string to be converted.protected final org.agilewiki.jactor.factory.ActorFactory getEntryFactory() throws Exception
getEntryFactory
in class ListJid<MapEntry<KEY_TYPE extends Comparable<KEY_TYPE>,VALUE_TYPE extends Jid>>
Exception
protected org.agilewiki.jactor.factory.ActorFactory getValueFactory() throws Exception
Exception
public final int search(KEY_TYPE key) throws Exception
key
- The key which matches to the entry's first element.Exception
public final int higher(KEY_TYPE key) throws Exception
key
- The key which matches to the entry's first element.Exception
public final int match(KEY_TYPE key) throws Exception
key
- The key which matches to the entry's first element, or size.Exception
public final int ceiling(KEY_TYPE key) throws Exception
key
- The key which matches to the entry's first element.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
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 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> 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 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 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 _Jid resolvePathname(String pathname) throws Exception
resolvePathname
in interface _Jid
resolvePathname
in class ListJid<MapEntry<KEY_TYPE extends Comparable<KEY_TYPE>,VALUE_TYPE extends 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.