|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.activemq.apollo.util.path.PathMap<Value>
public class PathMap<Value>
A Map-like data structure allowing values to be indexed by
AsciiBuffer
and retrieved by path - supporting both *
and > style of wildcard as well as composite paths.
This class assumes that the index changes rarely but that fast lookup into
the index is required. So this class maintains a pre-calculated index for
path steps. So looking up the values for "TEST.*" or "*.TEST" will be
pretty fast.
Looking up of a value could return a single value or a List of matching
values if a wildcard or composite path is used.
Constructor Summary | |
---|---|
PathMap()
|
Method Summary | |
---|---|
Value |
chooseValue(Path path)
Returns the value which matches the given path or null if there is no matching value. |
protected java.util.Set<Value> |
findWildcardMatches(Path path)
|
java.util.Set<Value> |
get(Path key)
Looks up the value(s) matching the given AsciiBuffer key. |
PathMapNode<Value> |
getRootNode()
|
void |
put(Path key,
Value value)
|
boolean |
remove(Path path,
Value value)
Removes the value from the associated path |
java.util.Set<Value> |
removeAll(Path key)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PathMap()
Method Detail |
---|
public java.util.Set<Value> get(Path key)
key
- the path to lookup
public void put(Path key, Value value)
public boolean remove(Path path, Value value)
public PathMapNode<Value> getRootNode()
protected java.util.Set<Value> findWildcardMatches(Path path)
public java.util.Set<Value> removeAll(Path key)
key
-
public Value chooseValue(Path path)
path
- the path to find the value for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |