/** * Returns the utterance associated with this item. * * @return the utterance that contains this item */ public Utterance getUtterance() { return getOwnerRelation().getUtterance(); }
newItem = new Item(getOwnerRelation(), contents); newItem.prev = this.prev; if (this.prev != null) {
/** * Adds the given item as a daughter to this item. * * @param item for the new daughter * @return created item */ public Item addDaughter(Item item) { Item newItem; ItemContents contents; Item p = getLastDaughter(); if (p != null) { newItem = p.appendItem(item); } else { if (item == null) { contents = new ItemContents(); } else { contents = item.getSharedContents(); } newItem = new Item(getOwnerRelation(), contents); newItem.parent = this; daughter = newItem; } return newItem; }
/** * Appends an item in this list after this item. * * @param originalItem new item has shared contents with this item (or * * null) * * @return the newly appended item */ public Item appendItem(Item originalItem) { ItemContents contents; Item newItem; if (originalItem == null) { contents = null; } else { contents = originalItem.getSharedContents(); } newItem = new Item(getOwnerRelation(), contents); newItem.next = this.next; if (this.next != null) { this.next.prev = newItem; } attach(newItem); if (this.ownerRelation.getTail() == this) { this.ownerRelation.setTail(newItem); } return newItem; }
/** * Returns the utterance associated with this item. * * @return the utterance that contains this item */ public Utterance getUtterance() { return getOwnerRelation().getUtterance(); }
newItem = new Item(getOwnerRelation(), contents); newItem.prev = this.prev; if (this.prev != null) {
/** * Adds the given item as a daughter to this item. * * @param item for the new daughter * @return created item */ public Item addDaughter(Item item) { Item newItem; ItemContents contents; Item p = getLastDaughter(); if (p != null) { newItem = p.appendItem(item); } else { if (item == null) { contents = new ItemContents(); } else { contents = item.getSharedContents(); } newItem = new Item(getOwnerRelation(), contents); newItem.parent = this; daughter = newItem; } return newItem; }
/** * Appends an item in this list after this item. * * @param originalItem new item has shared contents with this item (or * * null) * * @return the newly appended item */ public Item appendItem(Item originalItem) { ItemContents contents; Item newItem; if (originalItem == null) { contents = null; } else { contents = originalItem.getSharedContents(); } newItem = new Item(getOwnerRelation(), contents); newItem.next = this.next; if (this.next != null) { this.next.prev = newItem; } attach(newItem); if (this.ownerRelation.getTail() == this) { this.ownerRelation.setTail(newItem); } return newItem; }