|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FeatureStructure
Interface for feature structures.
Note that object identity is not meaningful for feature structures. You may ask the CAS for the
same feature structure two times in a row, and get different object references. Use
equals()
instead.
Method Summary | |
---|---|
Object |
clone()
Creates a copy of this feature structure. |
boolean |
equals(Object o)
A feature structure is equal to another feature structure iff it is identical in the underlying representation. |
boolean |
getBooleanValue(Feature feat)
Get the boolean value of a feature. |
byte |
getByteValue(Feature feat)
Get the byte value of a feature. |
CAS |
getCAS()
Return the CAS that this FS belongs to. |
double |
getDoubleValue(Feature feat)
Get the double value of a feature. |
FeatureStructure |
getFeatureValue(Feature feat)
Get a feature value. |
String |
getFeatureValueAsString(Feature feat)
Get the value of the feature as a string if the type of the feature is one of the primitive type. |
float |
getFloatValue(Feature feat)
Get the float value of a feature. |
int |
getIntValue(Feature feat)
Get the int value of a feature. |
long |
getLongValue(Feature feat)
Get the long value of a feature. |
short |
getShortValue(Feature feat)
Get the short value of a feature. |
String |
getStringValue(Feature f)
Get the string value under a feature. |
Type |
getType()
Get the type of this FS. |
int |
hashCode()
Will return a hash code that's consistent with equality, i.e., if two FSs are equal, they will also return the same hash code. |
void |
setBooleanValue(Feature feat,
boolean i)
Set the boolean value of a feature. |
void |
setByteValue(Feature feat,
byte i)
Set the byte (8 bit) value of a feature. |
void |
setDoubleValue(Feature feat,
double i)
Set the double value of a feature. |
void |
setFeatureValue(Feature feat,
FeatureStructure fs)
Set a feature value to another FS. |
void |
setFeatureValueFromString(Feature feat,
String s)
Sets the value of a feature from a string input if the feature type is one of the primitive types. |
void |
setFloatValue(Feature feat,
float f)
Set the float value of a feature. |
void |
setIntValue(Feature feat,
int i)
Set the int value of a feature. |
void |
setLongValue(Feature feat,
long i)
Set the long (64 bit) value of a feature. |
void |
setShortValue(Feature feat,
short i)
Set the short (16 bit) value of a feature. |
void |
setStringValue(Feature feat,
String s)
Set the string value of a feature. |
Method Detail |
---|
Type getType()
void setFeatureValue(Feature feat, FeatureStructure fs) throws CASRuntimeException
feat
- The feature whose value should be set.fs
- The value FS.
CASRuntimeException
- If there is a typing violation, i.e., if feat
is not defined for
the type of this FS, or the range type of feat
is not a supertype
of fs.getType()
.FeatureStructure getFeatureValue(Feature feat) throws CASRuntimeException
feat
- The feature whose value we want to get.
null
if the value has not been set.
CASRuntimeException
- If there is a typing violation, i.e., if feat
is not defined for
the type of this FS, or the range type of feat
is Float, Integer or
String.void setStringValue(Feature feat, String s) throws CASRuntimeException
feat
- The feature whose value we want to set.s
- The string we're setting the feature to.
CASRuntimeException
- If there is a typing violation, i.e., if feat
is not defined for
this.getType()
or feat.getRange()
is not
CAS.STRING_TYPE
.String getStringValue(Feature f) throws CASRuntimeException
f
- The feature for which we want the value.
null
if the value has not been set.
CASRuntimeException
- If there is a typing violation, i.e., if f
is not defined for the
type of this feature structure, or if the range type of f
is not
String.float getFloatValue(Feature feat) throws CASRuntimeException
feat
- The feature whose value we want to get.
0.0
if the value has not been set.
CASRuntimeException
- If feat
is not defined for the type of this FS, or if it is not
float valued.void setFloatValue(Feature feat, float f) throws CASRuntimeException
feat
- The feature whose value we want to set.f
- The float we're setting the feature to.
CASRuntimeException
- If feat
is not defined for the type of this FS, or if it is not
float valued.int getIntValue(Feature feat) throws CASRuntimeException
feat
- The feature whose value we want to get.
0
if the value has not been set.
CASRuntimeException
- If feat
is not defined for the type of this FS, or if it is not int
valued.void setIntValue(Feature feat, int i) throws CASRuntimeException
feat
- The feature whose value we want to set.i
- The int we're setting the feature to.
CASRuntimeException
byte getByteValue(Feature feat) throws CASRuntimeException
feat
- The feature whose value we want to set.
0
if the value has not been set.
CASRuntimeException
void setByteValue(Feature feat, byte i) throws CASRuntimeException
feat
- The feature whose value we want to set.i
- The 8bit value we're setting the feature to.
CASRuntimeException
boolean getBooleanValue(Feature feat) throws CASRuntimeException
feat
- The feature whose value we want to get.
0
if the value has not been set.
CASRuntimeException
- If feat
is not defined for the type of this FS, or if it is not
boolean valued.void setBooleanValue(Feature feat, boolean i) throws CASRuntimeException
feat
- The feature whose value we want to set.i
- The boolean value we're setting the feature to.
CASRuntimeException
short getShortValue(Feature feat) throws CASRuntimeException
feat
- The feature whose value we want to get.
0
if the value has not been set.
CASRuntimeException
- If feat
is not defined for the type of this FS, or if it is not
short valued.void setShortValue(Feature feat, short i) throws CASRuntimeException
feat
- The feature whose value we want to set.i
- The short (16bit) value we're setting the feature to.
CASRuntimeException
long getLongValue(Feature feat) throws CASRuntimeException
feat
- The feature whose value we want to get.
0
if the value has not been set.
CASRuntimeException
- If feat
is not defined for the type of this FS, or if it is not
long valued.void setLongValue(Feature feat, long i) throws CASRuntimeException
feat
- The feature whose value we want to set.i
- The long (64bit) value we're setting the feature to.
CASRuntimeException
double getDoubleValue(Feature feat) throws CASRuntimeException
feat
- The feature whose value we want to get.
0
if the value has not been set.
CASRuntimeException
- If feat
is not defined for the type of this FS, or if it is not
double valued.void setDoubleValue(Feature feat, double i) throws CASRuntimeException
feat
- The feature whose value we want to set.i
- The double value we're setting the feature to.
CASRuntimeException
String getFeatureValueAsString(Feature feat) throws CASRuntimeException
feat
- The feature whose value we want to get and whose type is one of the primitve types.
CASRuntimeException
- If feat
is not defined for the type of this FS, or if the type is not
a primitive type.void setFeatureValueFromString(Feature feat, String s) throws CASRuntimeException
featThe
- feature whose value we want to set.s
- The string value that the feature will be set to.
CASRuntimeException
- If feat
is not a primitive type or the value cannot be converted to
this type.boolean equals(Object o) throws ClassCastException
equals
in class Object
ClassCastException
- If o
is not a FS.Object clone() throws CASRuntimeException
CASRuntimeException
int hashCode()
hashCode
in class Object
CAS getCAS()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |