|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectJet.Lisp.FeatureSet
A FeatureSet provides a mapping from interned Strings to Objects. It is intended to provide an efficient implementation for small numbers of features.
Field Summary | |
protected java.util.Vector |
features
|
protected java.util.Vector |
values
|
Constructor Summary | |
FeatureSet()
Creates an empty FeatureSet. |
|
FeatureSet(FeatureSet fs)
creates a new FeatureSet with the same features and values as fs . |
|
FeatureSet(java.io.StreamTokenizer tok,
boolean allowVariables,
char endChar)
This constructor reads a feature set from StreamTokenizer tok. |
|
FeatureSet(java.lang.String feat1,
java.lang.Object val1)
Creates a FeatureSet with one feature/value pair. |
|
FeatureSet(java.lang.String feat1,
java.lang.Object val1,
java.lang.String feat2,
java.lang.Object val2)
Creates a FeatureSet with two feature/value pairs. |
|
FeatureSet(java.lang.String feat1,
java.lang.Object val1,
java.lang.String feat2,
java.lang.Object val2,
java.lang.String feat3,
java.lang.Object val3)
Creates a FeatureSet with three feature/value pairs. |
Method Summary | |
boolean |
containsFeature(java.lang.String feat)
Returns true if the FeatureSet has feature feat with some value, possibly null . |
boolean |
equals(FeatureSet fs)
Returns true if the FeatureSet is equal to fs: whether the two FeatureSets have the same features with equal values. |
java.lang.Object |
get(java.lang.String feat)
Returns the value associated with feature feat. |
java.util.Enumeration |
keys()
Returns an Enumeration over the features in the feature set. |
void |
prepareToMakeString(int nestingLimit)
add 'id' feature to all Annotations referenced by this FeatureSet. |
void |
put(java.lang.String feat,
java.lang.Object val)
Associates the specified value val with the feature feat. |
void |
putAll(FeatureSet fs)
putAll adds all the feature/value pairs in FeatureSet fs |
int |
size()
returns the number of features in the FeatureSet. |
boolean |
subsetOf(FeatureSet fs)
returns true if the FeatureSet is contained in fs :
if every feature in the FeatureSet is present in fs
with the same value. |
FeatureSet |
substitute(java.util.HashMap bindings)
Returns a new feature set in which every value of the original feature set which is a variable has been replace by the binding of that variable in bindings. |
java.lang.String |
toSGMLString()
returns a string representation of the feature set, without enclosing braces, of the form feature1=value1 feature2=value2 ... which is suitable when the feature set is part of an annotation or SGML tag. |
java.lang.String |
toSGMLString(int nestingLimit,
boolean quoteValues)
returns a string representation of the feature set, without enclosing braces, of the form feature1=value1 feature2=value2 ... which is suitable when the feature set is part of an annotation or SGML tag. |
java.lang.String |
toString()
returns a printable form of the feature set, of the form [feature1=value1 feature2=value2 ...]. |
static FeatureSet |
unify(FeatureSet a,
FeatureSet b)
If every feature which occurs in both FeatureSets a and b has the same value in both FeatureSets, returns a new FeatureSet with the union of the features; otherwise returns null. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.Vector features
protected java.util.Vector values
Constructor Detail |
public FeatureSet()
public FeatureSet(java.lang.String feat1, java.lang.Object val1)
public FeatureSet(java.lang.String feat1, java.lang.Object val1, java.lang.String feat2, java.lang.Object val2)
public FeatureSet(java.lang.String feat1, java.lang.Object val1, java.lang.String feat2, java.lang.Object val2, java.lang.String feat3, java.lang.Object val3)
public FeatureSet(FeatureSet fs)
fs
.
public FeatureSet(java.io.StreamTokenizer tok, boolean allowVariables, char endChar) throws java.io.IOException, PatternSyntaxError
Method Detail |
public void put(java.lang.String feat, java.lang.Object val)
public void putAll(FeatureSet fs)
public java.lang.Object get(java.lang.String feat)
public boolean containsFeature(java.lang.String feat)
null
.
public boolean subsetOf(FeatureSet fs)
fs
:
if every feature in the FeatureSet is present in fs
with the same value.
public boolean equals(FeatureSet fs)
public java.util.Enumeration keys()
public int size()
public FeatureSet substitute(java.util.HashMap bindings)
public static FeatureSet unify(FeatureSet a, FeatureSet b)
public java.lang.String toString()
public java.lang.String toSGMLString()
public java.lang.String toSGMLString(int nestingLimit, boolean quoteValues)
nestingLimit
- limit of depth of nested Annotations which
will be represented in the String. Beyond
that limit, references to Annotations are
rendered as '#nnn', where 'nnn' is the 'id'
feature of the referenced Annotation.quoteValues
- if true, values of features are enclosed in
double quotes, as required by XML.public void prepareToMakeString(int nestingLimit)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |