/** * Creates an item. The item is coupled to a particular Relation. If shared * contents is null a new sharedContents is created. * * @param relation the relation that owns this item * @param sharedContents the contents that is shared with others. If null, * a new sharedContents is created. */ public Item(Relation relation, ItemContents sharedContents) { ownerRelation = relation; if (sharedContents != null) { contents = sharedContents; } else { contents = new ItemContents(); } parent = null; daughter = null; next = null; prev = null; getSharedContents().addItemRelation(relation.getName(), this); }
/** * Creates an item. The item is coupled to a particular Relation. If shared * contents is null a new sharedContents is created. * * @param relation the relation that owns this item * @param sharedContents the contents that is shared with others. If null, * a new sharedContents is created. */ public Item(Relation relation, ItemContents sharedContents) { ownerRelation = relation; if (sharedContents != null) { contents = sharedContents; } else { contents = new ItemContents(); } parent = null; daughter = null; next = null; prev = null; getSharedContents().addItemRelation(relation.getName(), this); }