|
CAR (Context-Aware Retrieval) v1.0 | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Field
A Field is a container class for a tag (field name), an AttributeTuple, a ValueTuple, aand a CommentTuple. As it name suggest a CommentTuple contains a vector of comments associated with the field.
See the Basic Terminology section of the User Manual for a description of the other elements of a field.
Field Summary | |
protected ValueTuple |
valueTuple
the field's valueTuple |
protected ValueTupleVector |
valueTupleVector
for system programmer's use only |
Fields inherited from interface CarFace |
BOOLEAN_LITERAL, COLLECTION, DOUBLE_LITERAL, EXTERNAL, grammarNames, INTERNAL, KEYPHRASE, LITERALcapacityIncrement, LITERALinitialCapacity, MARKUP, SERIAL, SESSION, STRING_LITERAL, STRINGVALUE_LITERAL |
Constructor Summary | |
protected |
Field(java.lang.String fn)
constructs a Field named with the input. |
|
Field(java.lang.String fn,
AttributeTuple at,
ValueTuple vt,
CommentTuple ct)
constructs a Field with the inputs. |
|
Field(java.lang.String fn,
AttributeTuple at,
ValueTupleVector vtv,
CommentTuple ct)
for system programmer's use only |
protected |
Field(java.lang.String fn,
AttributeTuple at,
ValueTupleVector vtv,
ValueTuple vt,
CommentTuple ct)
for system programmer's use only |
|
Field(java.lang.String fn,
double value)
constructs a Field with the inputs. |
|
Field(java.lang.String fn,
java.lang.String value)
constructs a Field with the inputs. |
Method Summary | |
java.lang.Object |
clone()
creates a clone of the field object |
AttributeTuple |
getAttributeTuple()
returns the attributeTuple of the field |
java.lang.String |
getAttributeValue(java.lang.String name)
gets the field's attribute value for the given attribute name. |
CommentTuple |
getCommentTuple()
returns the commentTuple of the field |
java.lang.String |
getFieldName()
returns the name of the field |
java.lang.String[] |
getLabelledStringValues(java.lang.String label)
for system programmer's use only |
double |
getNumericValue()
gets the numeric value of the first Value of the field's valuetuple. |
ValueTuple |
getValueTuple()
returns the valueTuple of the field |
ValueTupleVector |
getValueTupleVector()
for system programmer's use only |
boolean |
hasAttribute(java.lang.String name)
indicate whether the provided name is the name of an attribute in the field's attributeTuple |
boolean |
hasValue()
indicates whether the valueTuple of the field contains a Value (returns false if Value has 0 elements). |
void |
removeAttribute(java.lang.String name)
remove the attribute with the provided name from the field's attributeTuple. |
void |
removeValue()
sets the valueTuple to be empty (zero elements) |
boolean |
sameAttributeTuple(Field f)
indicates whether this field contains the same attributeTuple (same name=value pairs - order insignificant) as the provided field |
boolean |
sameValue(Field f)
returns true if this field has the same valueTuple (values are same) as the one provided, else returns false |
double |
score(Field queryField)
use the default scoring mechanism to score this target field value against the value of the provided queryField argument. |
void |
setAttribute(java.lang.String name,
java.lang.String value)
overwrite the existing attributeTuple with a new one consisting of a single Attribute made from the provided attribute pair. |
void |
setFieldName(java.lang.String name)
set the field's name to the one provided |
void |
setNumericValue(double value)
sets the field's valueTuple to a single Value of type DOUBLE_LITERAL, overwriting the previous valueTuple |
void |
setValue(Value val)
sets the field's valueTuple to the single Value provided, overwriting the previous valueTuple |
void |
setValueTuple(ValueTuple vt)
overwrite the existing valueTuple with the one provided |
protected void |
sleep(int millisecs)
for system programmer's use only |
void |
t(java.lang.String s)
Provides trace output of string if -dField on command line of CAR run |
java.lang.String |
toString()
converts the field to a string. |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected ValueTuple valueTuple
protected ValueTupleVector valueTupleVector
Constructor Detail |
public Field(java.lang.String fn, AttributeTuple at, ValueTuple vt, CommentTuple ct)
fn
- field nameat
- attributeTuplevt
- valueTuplect
- commentTuplepublic Field(java.lang.String fn, AttributeTuple at, ValueTupleVector vtv, CommentTuple ct)
public Field(java.lang.String fn, java.lang.String value)
fn
- field namevalue
- the STRINGVALUE_LITERAL Value to be put in the ValueTuplepublic Field(java.lang.String fn, double value)
fn
- field namevalue
- the DOUBLE_LITERAL Value to be put in the ValueTupleprotected Field(java.lang.String fn, AttributeTuple at, ValueTupleVector vtv, ValueTuple vt, CommentTuple ct)
protected Field(java.lang.String fn)
Method Detail |
public void t(java.lang.String s)
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String getFieldName()
public AttributeTuple getAttributeTuple()
public ValueTuple getValueTuple()
public ValueTupleVector getValueTupleVector()
public CommentTuple getCommentTuple()
public void setFieldName(java.lang.String name)
public boolean hasValue()
public double getNumericValue()
public java.lang.String getAttributeValue(java.lang.String name)
name
- the name of the attributepublic void setNumericValue(double value)
public void setValue(Value val)
public void setValueTuple(ValueTuple vt)
public void removeValue()
public boolean sameValue(Field f)
public void setAttribute(java.lang.String name, java.lang.String value)
name
- name of the attributevalue
- value of the attributepublic void removeAttribute(java.lang.String name)
public boolean hasAttribute(java.lang.String name)
public java.lang.String[] getLabelledStringValues(java.lang.String label)
public boolean sameAttributeTuple(Field f)
public double score(Field queryField)
ValueTuple.score(ValueTuple)
,
Value.score(Value)
protected void sleep(int millisecs)
public java.lang.String toString()
toString
in class java.lang.Object
|
CAR (Context-Aware Retrieval) v1.0 | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |