|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.speech.freetts.Item
Represents a node in a Relation. Items can have shared contents but each item has its own set of Daughters. The shared contents of an item (represented by ItemContents) includes the feature set for the item and the set of all relations that this item is contained in. An item can be contained in a number of relations and as daughters to other items. This class is used to keep track of all of these relationships. There may be many instances of item that reference the same shared ItemContents.
Constructor Summary | |
Item(Relation relation,
ItemContents sharedContents)
Creates an item. |
Method Summary | |
Item |
addDaughter(Item item)
Adds the given item as a daughter to this item. |
Item |
appendItem(Item originalItem)
Appends an item in this list after this item. |
Item |
createDaughter()
Creates a new Item, adds it as a daughter to this item and returns the new item. |
void |
dump(java.io.PrintWriter out,
int pad,
java.lang.String title)
Dumps out this item to the given output stream. |
boolean |
equalsShared(Item otherItem)
Determines if the shared contents of the two items are the same. |
java.lang.Object |
findFeature(java.lang.String pathAndFeature)
Finds the feature by following the given path. |
Item |
findItem(java.lang.String path)
Finds the item specified by the given path. |
Item |
getDaughter()
Retrieves the first daughter of this item. |
FeatureSet |
getFeatures()
Returns the feature set of this item. |
Item |
getItemAs(java.lang.String relationName)
Finds the item in the given relation that has the same shared contents. |
Item |
getLastDaughter()
Retrieves the last daughter of this item. |
Item |
getNext()
Gets the next item in this list. |
Item |
getNthDaughter(int which)
Retrieves the Nth daughter of this item. |
Relation |
getOwnerRelation()
Retrieves the owning Relation. |
Item |
getParent()
Returns the parent of this item. |
Item |
getPrevious()
Gets the previous item in this list. |
ItemContents |
getSharedContents()
Retrieves the shared contents for this item. |
Utterance |
getUtterance()
Returns the utterance associated with this item. |
boolean |
hasDaughters()
Determines if this item has daughters. |
Item |
prependItem(Item originalItem)
Prepends an item in this list before this item. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Item(Relation relation, ItemContents sharedContents)
relation
- the relation that owns this itemsharedContents
- the contents that is shared with others.
If null, a new sharedContents is created.Method Detail |
public Item getItemAs(java.lang.String relationName)
relationName
- the relation of interest
public Relation getOwnerRelation()
public ItemContents getSharedContents()
public boolean hasDaughters()
public Item getDaughter()
public Item getNthDaughter(int which)
which
- the index of the daughter to return
public Item getLastDaughter()
public Item addDaughter(Item item)
item
- the new daughterpublic Item createDaughter()
public Item getParent()
public Utterance getUtterance()
public FeatureSet getFeatures()
public void dump(java.io.PrintWriter out, int pad, java.lang.String title)
dump
in interface Dumpable
out
- where to send the outputpad
- the leading whitspacetitle
- the title for the dumppublic java.lang.Object findFeature(java.lang.String pathAndFeature)
pathAndFeature
- the path to followpublic Item findItem(java.lang.String path)
path
- the path to follow
public Item getNext()
public Item getPrevious()
public Item appendItem(Item originalItem)
originalItem
- new item has shared contents with this
item (or * null)
public Item prependItem(Item originalItem)
originalItem
- new item has shared contents with this
item (or * null)
public java.lang.String toString()
public boolean equalsShared(Item otherItem)
otherItem
- the item to compare
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |