Class StaleTimestamp


public class StaleTimestamp
extends Field

This class demonstrates how to subclass the Field method for exotic matching behavior. It is used to compare a timestamp in a Tuple template against the Tuples in the database and select all the stale tuples.

Pete Wyckoff, John Thomas
See Also:
Field, TupleSpace, Serialized Form

Fields inherited from class
isFormal, theName, theType, theTypeString, theValue
Constructor Summary
StaleTimestamp(long newval)
          construct a StaleTimestamp, only way to do it for now if via a single long
Method Summary
 boolean matches(Field f)
          match based on the less than criterion.
Methods inherited from class
assign, clone, formal, getName, getType, getValue, isFormal, main, makeField, name, setFormal, setFormal, setName, setType, setValue, toString, type, value
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public StaleTimestamp(long newval)
               throws TupleSpaceException
construct a StaleTimestamp, only way to do it for now if via a single long
newval - the long
TupleSpaceException - if there is aproblem creating the field
Method Detail


public boolean matches(Field f)
match based on the less than criterion. This Field is used to select Tuples whose Timestamp is older than the current time. It is important to use this Field value only in the template so that it be the object that is being compared to the value in the real tuple.
matches in class Field
f - the other field --- the one that we are checking against
true if the other fields value is less than this ones and the other is a Long