org.drools.reteoo
Class TupleSet
java.lang.Object
org.drools.reteoo.TupleSet
- All Implemented Interfaces:
- Serializable
class TupleSet
- extends Object
- implements Serializable
A set of Tuples indexed by TupleKeys.
- Author:
- bob mcwhirter
TupleSet
TupleSet()
- Construct.
TupleSet
TupleSet(int initialCapacity,
float loadFactor)
- Construct.
- Parameters:
initialCapacity
- The initial capacity of the set.loadFactor
- The load factor of the set.
TupleSet
TupleSet(ReteTuple tuple)
- Construct with a single tuple.
- Parameters:
tuple
- The tuple.
size
public int size()
- Retrieve the size (number of tuples) in this set.
- Returns:
- The size of this set.
isEmpty
public boolean isEmpty()
- Return empty status
- Returns:
- The size of this set.
addTuple
public void addTuple(ReteTuple tuple)
- Add a single
Tuple
to this set.
- Parameters:
tuple
- The tuple.
removeAllTuples
public boolean removeAllTuples(TupleKey key)
- Retract tuples from this memory.
- Parameters:
key
- The key for the tuples to be removed.
- Returns:
true
if at least one tuple was removed; false
otherwise.
getTuple
public ReteTuple getTuple(TupleKey key)
- Retrieve a
Tuple
by TupleKey
.
- Parameters:
key
- The tuple key.
- Returns:
- The matching tuple or
null
if this set contains no
matching tuple.
removeTuple
public void removeTuple(TupleKey key)
- Remove a tuple from this set.
- Parameters:
key
- Key matching the tuple.
iterator
public Iterator iterator()
- Retrieve an iterator over the tuples.
- Returns:
- The iterator.
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2001-2005 The Codehaus. All Rights Reserved.