|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents a single typed field of a tuple. The type of a field can be any
class implementing the Serializable
interface. A field can
either contain a value, or be characterized just by its type. In Linda
jargon, the former is called an actual field, while the latter is
called a formal field. Tuples with formals are typically used as a
template to query the tuple space by pattern matching. Different
matching rules can be implemented by redefining the matches
method.
Formals and actuals are set by using two separate methods,
setToFormal
and setToActual
. null
is a legal value for the domain on which the type of the field is defined,
thus fields whose value is null
are considered to be
actuals. Nevertheless, the null
value must be specified by
using a special method setToNullActual
. Had the
null
value been set using setToActual(null)
, it
would have been impossible to determine the type of the actual. Hence,
null
fields should not be considered as formals by the
classes implementing this interface.
Method Summary | |
java.lang.Class |
getType()
Returns the type of this field. |
java.io.Serializable |
getValue()
Returns the value of this field. |
boolean |
isFormal()
Returns true if the field is a formal, false
otherwise. |
boolean |
matches(IField field)
Determines the rule used for pattern matching between fields. |
IField |
set(IField field)
Substitutes this field with the one passed as a parameter. |
IField |
setToActual(java.io.Serializable obj)
Sets the value of this field to the object passed as a parameter. |
IField |
setToFormal(java.lang.Class classObj)
Sets this field to be a formal whose type becomes the class passed as a parameter. |
IField |
setToNullActual(java.lang.Class classObj)
Sets the value of this field to null . |
Method Detail |
public IField set(IField field)
field
is a formal, this field becomes a formal with
field
's type. If field
is an actual, this
fields becomes an actual with the type and value of field
.field
- the field to be assigned.public java.io.Serializable getValue()
public java.lang.Class getType()
public IField setToActual(java.io.Serializable obj)
obj
- the new value of the field.public IField setToNullActual(java.lang.Class classObj)
null
. The type of the field
is set to the class passed as a parameter.classObj
- the class to be associated to the null
actual.public IField setToFormal(java.lang.Class classObj)
classObj
- the new type of this field.public boolean isFormal()
true
if the field is a formal, false
otherwise.public boolean matches(IField field)
true
if the field passed as a parameter matches
this field, false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |