All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.tspaces.SuperTuple
java.lang.Object
|
+----com.ibm.tspaces.SuperTuple
- public abstract class SuperTuple
- extends Object
- implements Serializable
A SuperTuple is an ordered sequence of Fields. Since it's abstract,
any SuperTuple is actually either a Tuple or a SubclassableTuple.
The standard matching algorithm for Tuples is based on structural
equivalence. If two tuples (1) have the same number of Fields, (2)
the fields are the same type, (3) fields with value (actuals) have the
same value, and (4) fields without values (formals) are not matched
against other formals, the tuples will match. For SubclassableTuples,
the type (Class) of the target tuple must be a subclass of the Class
of this tuple. (This implies that a Tuple will never match a
SubclassableTuple, and vice versa.)
- Author:
- Daniel Ford, Tobin Lehman, Stephen McLaughry, Peter Wyckoff
- See Also:
- Tuple, SubclassableTuple, Field, TupleSpace
-
SuperTuple()
- The default SuperTuple constructor.
-
SuperTuple(Serializable)
- Make a Tuple whose Field is the type and value of an Object.
-
SuperTuple(Serializable, Serializable)
- Make a SuperTuple whose Fields are the type and value of Objects.
-
SuperTuple(Serializable, Serializable, Serializable)
- Make a SuperTuple whose Fields are the type and value of Objects.
-
SuperTuple(Serializable, Serializable, Serializable, Serializable)
- Make a SuperTuple whose Fields are the type and value of Objects.
-
SuperTuple(Serializable, Serializable, Serializable, Serializable, Serializable)
- Make a SuperTuple whose Fields are the type and value of Objects.
-
SuperTuple(Serializable, Serializable, Serializable, Serializable, Serializable, Serializable)
- Make a SuperTuple whose Fields are the type and value of Objects.
-
SuperTuple(Serializable, Serializable, Serializable, Serializable, Serializable, Serializable, Serializable)
- Make a SuperTuple whose Fields are the type and value of Objects.
-
add(Class)
- Add a Field with the Class as its type (this is a "Formal" Field).
-
add(double)
- Add a Field for the integral type "double" by wrapping it as a Double.
-
add(Field)
- Add a Field to the SuperTuple.
-
add(float)
- Add a Field for the integral type "float" by wrapping it as a Float.
-
add(int)
- Add a Field for the integral type "int" by wrapping it as an Integer.
-
add(long)
- Add a Field for the integral type "long" by wrapping it as an Long.
-
add(Serializable)
- Add a Field with the Object as its value.
-
add(String)
- Add a String Field to the Tuple.
-
add(String, Class)
- Add a named Field with the Class as its type (this is a "Formal" Field).
-
add(String, double)
- Add a named Field for the integral type "double" by wrapping it as a Double.
-
add(String, float)
- Add a named Field for the integral type "float" by wrapping it as a Float.
-
add(String, int)
- Add a named Field for the integral type "int" by wrapping it as an Integer.
-
add(String, long)
- Add a Field for the integral type "long" by wrapping it as an Long.
-
add(String, Serializable)
- Add a named Field with the Object as its value.
-
add(String, String)
- Add a named String Field Tuple
-
changeName(String, String)
- Change the name of the named field.
-
debugOut()
- Print a string representation of the Tuple to standard out
-
fieldExists(String)
- Return true if the named Field exists in the Tuple.
-
fields()
- Return an enumeration of the Fields in the Tuple.
-
getField(int)
- Return the i'th Field in the Tuple.
-
getField(String)
- Return a named Field in the Tuple.
-
main(String[])
- Test routine for Tuple
-
matches(SuperTuple)
- Return true if the specified Tuple matches this Tuple.
-
numberOfFields()
- Return the number of fields in the Tuple.
-
printOn(PrintStream)
- Print the Fields of the Tuple on the PrintStream.
-
putField(Field, int)
- Set the i'th Field.
-
setFormal(int)
- Set the indexed Field to be formal
-
setFormal(String)
- Set the named Field to be formal
-
setName(String, int)
- Set the name of the indexed Field.
-
setType(String, Class)
- Set the type of a named field to the Class passed.
-
setValue(int, Serializable)
- Set the value of a field to the Object passed.
-
setValue(String, Serializable)
- Set the value of a named field to the Object passed.
-
structureName()
- Return a string representation of the Tuple's structure.
-
template()
- Return true if the Tuple is a template.
Deprecated.
-
toString()
- Return a string representation of the Tuple.
-
uniqueId()
-
-
uniqueId(int)
- Assign to the unique id.
SuperTuple
public SuperTuple()
- The default SuperTuple constructor. Constructs a NULL SuperTuple, one with no
Fields. Subsequent Fields can be added with the "add" method.
- See Also:
- add
SuperTuple
public SuperTuple(Serializable obj) throws TupleSpaceException
- Make a Tuple whose Field is the type and value of an Object.
If the object itself is a Field, then it will be used as the Field
and not as the Field's value.
- Parameters:
- obj - the value of the first Field of the Tuple.
SuperTuple
public SuperTuple(Serializable obj1,
Serializable obj2) throws TupleSpaceException
- Make a SuperTuple whose Fields are the type and value of Objects.
If any object itself is a Field, then it will be used as the Field
and not as the Field's value.
- Parameters:
- obj1 - the value of the first field of the SuperTuple.
- obj2 - the value of the second field of the SuperTuple.
SuperTuple
public SuperTuple(Serializable obj1,
Serializable obj2,
Serializable obj3) throws TupleSpaceException
- Make a SuperTuple whose Fields are the type and value of Objects.
If any object itself is a Field, then it will be used as the Field
and not as the Field's value.
- Parameters:
- obj1 - the value of the first field of the SuperTuple.
- obj2 - the value of the second field of the SuperTuple.
- obj3 - the value of the third field of the SuperTuple.
SuperTuple
public SuperTuple(Serializable obj1,
Serializable obj2,
Serializable obj3,
Serializable obj4) throws TupleSpaceException
- Make a SuperTuple whose Fields are the type and value of Objects.
If any object itself is a Field, then it will be used as the Field
and not as the Field's value.
- Parameters:
- obj1 - the value of the first field of the SuperTuple.
- obj2 - the value of the second field of the SuperTuple.
- obj3 - the value of the third field of the SuperTuple.
- obj4 - the value of the fourth field of the SuperTuple.
SuperTuple
public SuperTuple(Serializable obj1,
Serializable obj2,
Serializable obj3,
Serializable obj4,
Serializable obj5) throws TupleSpaceException
- Make a SuperTuple whose Fields are the type and value of Objects.
If any object itself is a Field, then it will be used as the Field
and not as the Field's value.
- Parameters:
- obj1 - the value of the first field of the SuperTuple.
- obj2 - the value of the second field of the SuperTuple.
- obj3 - the value of the third field of the SuperTuple.
- obj4 - the value of the fourth field of the SuperTuple.
- obj5 - the value of the fifth field of the SuperTuple.
SuperTuple
public SuperTuple(Serializable obj1,
Serializable obj2,
Serializable obj3,
Serializable obj4,
Serializable obj5,
Serializable obj6) throws TupleSpaceException
- Make a SuperTuple whose Fields are the type and value of Objects.
If any object itself is a Field, then it will be used as the Field
and not as the Field's value.
- Parameters:
- obj1 - the value of the first field of the SuperTuple.
- obj2 - the value of the second field of the SuperTuple.
- obj3 - the value of the third field of the SuperTuple.
- obj4 - the value of the fourth field of the SuperTuple.
- obj5 - the value of the fifth field of the SuperTuple.
- obj6 - the value of the sixth field of the SuperTuple.
SuperTuple
public SuperTuple(Serializable obj1,
Serializable obj2,
Serializable obj3,
Serializable obj4,
Serializable obj5,
Serializable obj6,
Serializable obj7) throws TupleSpaceException
- Make a SuperTuple whose Fields are the type and value of Objects.
If any object itself is a Field, then it will be used as the Field
and not as the Field's value.
- Parameters:
- obj1 - the value of the first field of the SuperTuple.
- obj2 - the value of the second field of the SuperTuple.
- obj3 - the value of the third field of the SuperTuple.
- obj4 - the value of the fourth field of the SuperTuple.
- obj5 - the value of the fifth field of the SuperTuple.
- obj6 - the value of the sixth field of the SuperTuple.
- obj7 - the value of the seventh field of the SuperTuple.
add
public void add(Field f_)
- Add a Field to the SuperTuple. It is added to the "end" of the
collection of the other Fields.
- Parameters:
- f_ - The Field to be added to the SuperTuple.
add
public void add(Class class_) throws TupleSpaceException
- Add a Field with the Class as its type (this is a "Formal" Field).
- Parameters:
- class_ - The type of the Field.
- See Also:
- Field, formal, Class
add
public void add(String name,
Class t) throws TupleSpaceException
- Add a named Field with the Class as its type (this is a "Formal" Field).
- Parameters:
- name - The name of the Field.
- t - The type of the Field.
- See Also:
- Field, formal, Class
add
public void add(Serializable obj_) throws TupleSpaceException
- Add a Field with the Object as its value. The type of the Field will
be the Class of the Object.
- Parameters:
- obj_ - The Object that is value of the new Field.
- See Also:
- Field
add
public void add(String name,
Serializable obj_) throws TupleSpaceException
- Add a named Field with the Object as its value. The type of the Field will
be the Class of the Object.
- Parameters:
- name - The name of the Field.
- obj_ - The Object that is value of the new Field.
- See Also:
- Field
add
public void add(String value_) throws TupleSpaceException
- Add a String Field to the Tuple.
- Parameters:
- value_ - A String that will be the value of the first Field of the
Tuple.
add
public void add(String name,
String value_) throws TupleSpaceException
- Add a named String Field Tuple
- Parameters:
- name - The name of the Field.
- value_ - A String that will be the value of the first Field of the
Tuple.
add
public void add(int i_) throws TupleSpaceException
- Add a Field for the integral type "int" by wrapping it as an Integer.
- Parameters:
- i_ - The integer that is the value of the value of the Field in
- See Also:
- Field, Integer
add
public void add(String name,
int i_) throws TupleSpaceException
- Add a named Field for the integral type "int" by wrapping it as an Integer.
- Parameters:
- name - The name of the Field.
- i_ - The integer that is the value of the value of the Field in
- See Also:
- Field, Integer
add
public void add(long l_) throws TupleSpaceException
- Add a Field for the integral type "long" by wrapping it as an Long.
- Parameters:
- l_ - The long that is the value of of the new Field in the Tuple.
- Throws: TupleSpaceException
- if there is a problem creating the fields
- See Also:
- Field, Long
add
public void add(String name,
long l_) throws TupleSpaceException
- Add a Field for the integral type "long" by wrapping it as an Long.
- Parameters:
- name - The name of the Field.
- l_ - The long that is the value of of the new Field in the Tuple.
- Throws: TupleSpaceException
- if there is a problem creating the fields
- See Also:
- Field, Long
add
public void add(double d_) throws TupleSpaceException
- Add a Field for the integral type "double" by wrapping it as a Double.
- Parameters:
- d_ - The double that is the value of the new Field of the Tuple
- Throws: TupleSpaceException
- if there is a problem creating the fields
- See Also:
- Field, Double
add
public void add(String name,
double d_) throws TupleSpaceException
- Add a named Field for the integral type "double" by wrapping it as a Double.
- Parameters:
- name - The name of the Field.
- d_ - The double that is the value of the new Field of the Tuple
- Throws: TupleSpaceException
- if there is a problem creating the fields
- See Also:
- Field, Double
add
public void add(float f_) throws TupleSpaceException
- Add a Field for the integral type "float" by wrapping it as a Float.
- Parameters:
- f_ - The float that is the value of the new Field of the Tuple.
- Throws: TupleSpaceException
- if there is a problem creating the fields
- See Also:
- Field, Float
add
public void add(String name,
float f_) throws TupleSpaceException
- Add a named Field for the integral type "float" by wrapping it as a Float.
- Parameters:
- name - The name of the Field.
- f_ - The float that is the value of the new Field of the Tuple.
- Throws: TupleSpaceException
- if there is a problem creating the fields
- See Also:
- Field, Float
setType
public void setType(String name,
Class t) throws TupleSpaceException
- Set the type of a named field to the Class passed. The old value of the
Field is discarded.
- Parameters:
- name - The name of the Field.
- t - The new type of the field.
- Throws: TupleSpaceException
- If no Field in the Tuple exists with
the given name.
- Throws: TupleSpaceException
- if there is a problem creating the fields
- See Also:
- Field
setValue
public void setValue(String name,
Serializable v) throws TupleSpaceException
- Set the value of a named field to the Object passed. The value of the
Field is the Class of the Object.
- Parameters:
- name - The name of the Field.
- v - The new value of the field.
- Throws: TupleSpaceException
- If no Field in the Tuple exists with
the given name.
- Throws: TupleSpaceException
- if there is a problem creating the fields
- See Also:
- Field
setValue
public void setValue(int i,
Serializable v) throws TupleSpaceException
- Set the value of a field to the Object passed. The value of the
Field is the Class of the Object.
- Parameters:
- i - The # of the Field.
- v - The new value of the field.
- Throws: TupleSpaceException
- If no Field in the Tuple exists with
the given name.
- Throws: TupleSpaceException
- if there is a problem creating the fields
- See Also:
- Field
setName
public void setName(String name,
int i) throws TupleSpaceException
- Set the name of the indexed Field.
- Parameters:
- name - The new name of the Field.
- i - The index of the field.
- Throws: TupleSpaceException
- If no Field at position i of the Tuple..
- Throws: TupleSpaceException
- if there is a problem creating the fields
- See Also:
- Field
setFormal
public void setFormal(int i) throws TupleSpaceException
- Set the indexed Field to be formal
- Parameters:
- i - The index of the field.
- Throws: TupleSpaceException
- If no Field at position i of the Tuple..
- Throws: TupleSpaceException
- if there is a problem creating the fields
- See Also:
- Field
setFormal
public void setFormal(String name) throws TupleSpaceException
- Set the named Field to be formal
- Parameters:
- name - The name of the Field.
- Throws: TupleSpaceException
- If no Field at position i of the Tuple..
- Throws: TupleSpaceException
- if there is a problem creating the fields
- See Also:
- Field
changeName
public void changeName(String oldName,
String newName) throws TupleSpaceException
- Change the name of the named field.
- Parameters:
- oldName - The old name of the Field.
- newName - The new name of the Field.
- Throws: TupleSpaceException
- If no Field in the Tuple exists with
the given name.
- Throws: TupleSpaceException
- if there is a problem creating the fields
- See Also:
- Field
putField
public void putField(Field f,
int i) throws TupleSpaceException
- Set the i'th Field.
- Parameters:
- f - The new Field.
- i - The position in the Tuple for the new Field.
- Throws: TupleSpaceException
- If no Field at position i of the Tuple..
- See Also:
- Field
getField
public Field getField(int i) throws TupleSpaceException
- Return the i'th Field in the Tuple.
- Parameters:
- i - The position of the Field in the Tuple
- Returns:
- The Field at position i.
- Throws: TupleSpaceException
- If no Field at position i of the Tuple.
- Throws: TupleSpaceException
- if there is a problem creating the fields
- See Also:
- Field
getField
public Field getField(String name) throws TupleSpaceException
- Return a named Field in the Tuple.
- Parameters:
- name - The name of the Field in the Tuple.
- Returns:
- The named Field.
- Throws: TupleSpaceException
- If no Field in the Tuple exists with
the given name.
- Throws: TupleSpaceException
- if there is a problem creating the fields
- See Also:
- Field
fields
public Enumeration fields()
- Return an enumeration of the Fields in the Tuple.
- Returns:
- An Enumeration.
- See Also:
- Field
numberOfFields
public int numberOfFields()
- Return the number of fields in the Tuple.
- Returns:
- The number of Fields in the Tuple.
- See Also:
- Field
uniqueId
public int uniqueId()
- Returns:
- the unique id assigned to this tuple by its
TSDB (id unique only inside the DB)
uniqueId
public void uniqueId(int id)
- Assign to the unique id. Should only be called by TSDB on
an insert and when ids need to be reshuffled.
matches
public boolean matches(SuperTuple t_)
- Return true if the specified Tuple matches this Tuple. A pair of
Tuples match if each of their corresponding Fields match.
- Parameters:
- t_ - The Tuple to compare.
- Returns:
- true if the Tuples are equal, false otherwise.
- See Also:
- equals
template
public boolean template()
- Note: template() is deprecated.
Since we no longer differentiate between "formal" and "actual"
tuples, this is no longer useful.
- Return true if the Tuple is a template. A Tuple is a
template if it has at least one formal Field.
- Returns:
- true if the Tuple has at least one formal Field
fieldExists
public boolean fieldExists(String name)
- Return true if the named Field exists in the Tuple.
- Parameters:
- name - The name of the Field to look for.
- Returns:
- true if the Tuple has a Field with the passed name.
structureName
public String structureName()
- Return a string representation of the Tuple's structure.
- Returns:
- String representation of the Tuple's structure.
toString
public String toString()
- Return a string representation of the Tuple.
- Returns:
- String representation of the Tuple.
- Overrides:
- toString in class Object
printOn
public void printOn(PrintStream pout)
- Print the Fields of the Tuple on the PrintStream.
debugOut
public void debugOut()
- Print a string representation of the Tuple to standard out
main
public static void main(String argv[])
- Test routine for Tuple
All Packages Class Hierarchy This Package Previous Next Index