public abstract class FeatureStructureImpl extends Object implements FeatureStructure, Cloneable
Constructor and Description |
---|
FeatureStructureImpl() |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a copy of this feature structure.
|
abstract int |
getAddress() |
int |
getavoidcollisionTypeCode() |
boolean |
getBooleanValue(Feature feat)
Get the boolean value of a feature.
|
byte |
getByteValue(Feature feat)
Get the byte value of a feature.
|
protected abstract CASImpl |
getCASImpl() |
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.
|
void |
prettyPrint(int indent,
int incr,
StringBuffer buf,
boolean useShortNames) |
void |
prettyPrint(int indent,
int incr,
StringBuffer buf,
boolean useShortNames,
String s) |
void |
prettyPrint(int indent,
int incr,
StringBuffer buf,
boolean useShortNames,
String s,
org.apache.uima.cas.impl.FeatureStructureImpl.PrintReferences printRefs) |
void |
setBooleanValue(Feature feat,
boolean b)
Set the boolean value of a feature.
|
void |
setByteValue(Feature feat,
byte val)
Set the byte (8 bit) value of a feature.
|
void |
setDoubleValue(Feature feat,
double val)
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 val)
Set the float value of a feature.
|
void |
setIntValue(Feature feat,
int val)
Set the int value of a feature.
|
void |
setLongValue(Feature feat,
long val)
Set the long (64 bit) value of a feature.
|
void |
setShortValue(Feature feat,
short val)
Set the short (16 bit) value of a feature.
|
void |
setStringValue(Feature feat,
String val)
Set the string value of a feature.
|
String |
toString() |
String |
toString(int indent) |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals, getCAS, hashCode
public abstract int getAddress()
protected abstract CASImpl getCASImpl()
public Type getType()
FeatureStructure
getType
in interface FeatureStructure
public int getavoidcollisionTypeCode()
public void setFeatureValue(Feature feat, FeatureStructure fs)
FeatureStructure
setFeatureValue
in interface FeatureStructure
feat
- The feature whose value should be set.fs
- The value FS.public void setIntValue(Feature feat, int val)
FeatureStructure
setIntValue
in interface FeatureStructure
feat
- The feature whose value we want to set.val
- The int we're setting the feature to.public void setFloatValue(Feature feat, float val)
FeatureStructure
setFloatValue
in interface FeatureStructure
feat
- The feature whose value we want to set.val
- The float we're setting the feature to.public void setStringValue(Feature feat, String val)
FeatureStructure
setStringValue
in interface FeatureStructure
feat
- The feature whose value we want to set.val
- The string we're setting the feature to.public void setByteValue(Feature feat, byte val) throws CASRuntimeException
FeatureStructure
setByteValue
in interface FeatureStructure
feat
- The feature whose value we want to set.val
- The 8bit value we're setting the feature to.CASRuntimeException
- tbdpublic void setBooleanValue(Feature feat, boolean b) throws CASRuntimeException
FeatureStructure
setBooleanValue
in interface FeatureStructure
feat
- The feature whose value we want to set.b
- The boolean value we're setting the feature to.CASRuntimeException
public void setShortValue(Feature feat, short val) throws CASRuntimeException
FeatureStructure
setShortValue
in interface FeatureStructure
feat
- The feature whose value we want to set.val
- The short (16bit) value we're setting the feature to.CASRuntimeException
public void setLongValue(Feature feat, long val) throws CASRuntimeException
FeatureStructure
setLongValue
in interface FeatureStructure
feat
- The feature whose value we want to set.val
- The long (64bit) value we're setting the feature to.CASRuntimeException
public void setDoubleValue(Feature feat, double val) throws CASRuntimeException
FeatureStructure
setDoubleValue
in interface FeatureStructure
feat
- The feature whose value we want to set.val
- The double value we're setting the feature to.CASRuntimeException
public void setFeatureValueFromString(Feature feat, String s) throws CASRuntimeException
FeatureStructure
setFeatureValueFromString
in interface FeatureStructure
feat
- The 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.public FeatureStructure getFeatureValue(Feature feat) throws CASRuntimeException
FeatureStructure
getFeatureValue
in interface FeatureStructure
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.public int getIntValue(Feature feat)
FeatureStructure
getIntValue
in interface FeatureStructure
feat
- The feature whose value we want to get.0
if the value has not been set.public float getFloatValue(Feature feat) throws CASRuntimeException
FeatureStructure
getFloatValue
in interface FeatureStructure
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.public String getStringValue(Feature f) throws CASRuntimeException
FeatureStructure
getStringValue
in interface FeatureStructure
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.public byte getByteValue(Feature feat) throws CASRuntimeException
FeatureStructure
getByteValue
in interface FeatureStructure
feat
- The feature whose value we want to set.0
if the value has not been set.CASRuntimeException
- tbdpublic boolean getBooleanValue(Feature feat) throws CASRuntimeException
FeatureStructure
getBooleanValue
in interface FeatureStructure
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.public short getShortValue(Feature feat) throws CASRuntimeException
FeatureStructure
getShortValue
in interface FeatureStructure
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.public long getLongValue(Feature feat) throws CASRuntimeException
FeatureStructure
getLongValue
in interface FeatureStructure
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.public double getDoubleValue(Feature feat) throws CASRuntimeException
FeatureStructure
getDoubleValue
in interface FeatureStructure
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.public String getFeatureValueAsString(Feature feat) throws CASRuntimeException
FeatureStructure
getFeatureValueAsString
in interface FeatureStructure
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.public String toString(int indent)
public void prettyPrint(int indent, int incr, StringBuffer buf, boolean useShortNames)
public void prettyPrint(int indent, int incr, StringBuffer buf, boolean useShortNames, String s)
public void prettyPrint(int indent, int incr, StringBuffer buf, boolean useShortNames, String s, org.apache.uima.cas.impl.FeatureStructureImpl.PrintReferences printRefs)
public Object clone() throws CASRuntimeException
FeatureStructure
clone
in interface FeatureStructure
clone
in class Object
CASRuntimeException
- passthruCopyright © 2006–2021 The Apache Software Foundation. All rights reserved.