public class Item extends Object implements Dumpable
Modifier and Type | Field and Description |
---|---|
private ItemContents |
contents |
private Item |
daughter |
private Item |
next |
private Relation |
ownerRelation |
private Item |
parent |
private Item |
prev |
Constructor and Description |
---|
Item(Relation relation,
ItemContents sharedContents)
Creates an item.
|
Modifier and Type | Method and Description |
---|---|
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.
|
(package private) void |
attach(Item item)
Attaches/appends an item to this one.
|
Item |
createDaughter()
Creates a new Item, adds it as a daughter to this item
and returns the new item.
|
void |
dump(PrintWriter out,
int pad,
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.
|
Object |
findFeature(String pathAndFeature)
Finds the feature by following the given path.
|
Item |
findItem(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(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.
|
String |
toString() |
private Relation ownerRelation
private ItemContents contents
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.public Item getItemAs(String relationName)
relationName
- the relation of interestpublic Relation getOwnerRelation()
public ItemContents getSharedContents()
public boolean hasDaughters()
public Item getDaughter()
public Item getNthDaughter(int which)
which
- the index of the daughter to returnpublic Item getLastDaughter()
public Item addDaughter(Item item)
item
- the new daughterpublic Item createDaughter()
public Utterance getUtterance()
public FeatureSet getFeatures()
public void dump(PrintWriter out, int pad, String title)
public Object findFeature(String pathAndFeature)
pathAndFeature
- the path to followpublic Item findItem(String path)
path
- the path to followpublic Item getPrevious()
public Item appendItem(Item originalItem)
originalItem
- new item has shared contents with this
item (or * null)void attach(Item item)
item
- the item to appendpublic Item prependItem(Item originalItem)
originalItem
- new item has shared contents with this
item (or * null)public boolean equalsShared(Item otherItem)
otherItem
- the item to compareWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses