|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ostore.dispatch.TrieNode
A node of a trie for use with a Classifier
object.
A TrieNode
stores the SinkIF
s associated with
the Filter
defined by the path from the root of the trie. It
also stores enough information about its children to recursively classify
QueueElementIF
s. Information about the requirement represented by
this TrieNode
is stored on the edge to this node from its
parent, not internally to this data structure.
Field Summary | |
---|---|
protected Vector |
fields
Contains the set of Field s checked by this node's
children. |
protected Vector |
priorities
Contains the priorities for the SinkIF s. |
protected Vector |
rates
Contains the pass rates for the SinkIF s. |
protected Vector |
sinks
Contains all of the SinkIF s to receive events which
satisfy this node's requirement. |
protected Vector |
value_maps
Contains the set of value->child mappings for each Field .
|
Constructor Summary | |
---|---|
protected |
TrieNode()
Creates a new TrieNode with no sinks or children. |
Method Summary | |
---|---|
void |
addChild(TrieNode child,
Field field,
Object value)
Add a child node with a specified field-value restriction. |
void |
addSink(SinkIF sink,
Integer priority,
double acceptance_rate)
Add a new SinkIF to receive for all
QueueElementIF satisfying this node in the trie. |
Object |
clone()
Performs a deeper copy than Object.clone would.
|
void |
collectSinks(QueueElementIF event,
HashMap found)
Recursively find all TrieNode s which pass the specified
event, collecting all the SinkIF s subscribed at each node. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Vector sinks
SinkIF
s to receive events which
satisfy this node's requirement.
protected Vector priorities
SinkIF
s. This
Vector
is parallel to sinks
.
protected Vector rates
SinkIF
s. This
Vector
is parallel to sinks
.
protected Vector fields
Field
s checked by this node's
children.
protected Vector value_maps
Field
.
This Vector
is parallel to fields
.
Constructor Detail |
protected TrieNode()
TrieNode
with no sinks or children.
Method Detail |
public void collectSinks(QueueElementIF event, HashMap found)
TrieNode
s which pass the specified
event, collecting all the SinkIF
s subscribed at each node.
event
- The QueueElementIF
to evaluate.found
- The set of SinkIF
s collected. Each
SinkIF
maps to its priority.public void addChild(TrieNode child, Field field, Object value)
QueueElementIF
which satisfies this node's restriction
should test the new child's as well.
child
- The node to add.field
- The Field
restricted by the child.value
- The value that Field
should have.public void addSink(SinkIF sink, Integer priority, double acceptance_rate)
SinkIF
to receive for all
QueueElementIF
satisfying this node in the trie.
sink
- the SinkIF
.priority
- a number between 0 (lowest priority) and 10 (highest).acceptance_rate
- the fraction of qualifying events to pass on
to the sink. Useful for sampling the input stream.public Object clone()
Object.clone
would.
The entire trie is cloned, and may be modified independently of the
original. The Field
s and SinkIF
s
referenced by the TrieNode
s are not cloned.
clone
in class Object
TrieNode
with cloned
internal data structures.public String toString()
toString
in class Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |