|
From: Andreas V. <a_...@us...> - 2004-04-15 17:33:16
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/item In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6615/src/org/cobricks/item Modified Files: Item.java Log Message: Index: Item.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/item/Item.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- Item.java 15 Apr 2004 15:57:33 -0000 1.20 +++ Item.java 15 Apr 2004 17:33:02 -0000 1.21 @@ -772,6 +772,11 @@ return Item.OBJECT_TYPE; } + /** + * This method returns the ItemAnnotation with the annotationId + * @param aid - the annotationId to be looked for + * @return - ItemAnnotation + */ public ItemAnnotation getAnnotation(int aid) { ItemAnnotation ia; @@ -791,11 +796,18 @@ return null; } - + /** + * this method returns a list containing all annotations of this item + * @return - ArrayList with ItemAnnotations + */ public List getAnnotations() { return new ArrayList(this.annotations.values()); } - + /** + * returns the ItemAttachment to the given itemAttachmentId + * @param aid - the ItemAttachmentId + * @return - the corresponding ItemAttachment + */ public ItemAttachment getAttachment(int aid) { ItemAttachment ia; @@ -815,7 +827,10 @@ return null; } - + /** + * returns a list containing all ItemAttachments of this Item + * @return - list of ItemAttachments + */ public List getAttachments() { return new ArrayList(this.attachments.values()); } @@ -848,13 +863,34 @@ public final void setItemClass(String itemClass) { this.itemclass = itemClass; } - protected void addItemAttachment(ItemAttachment ia){ - attachments.put(""+ia.getId(), ia); - } - protected void addItemAnnotation(ItemAnnotation ia){ - annotations.put(""+ia.getId(), ia); + /** + * Adds an ItemAttachment to the Item + * @param ia - an ItemAttachment + */ + protected void addItemAttachment(ItemAttachment ia) { + attachments.put("" + ia.getId(), ia); } - protected void deleteAllAttachments(){ + /** + * Adds an ItemAnnotation to the Item + * @param ia - an ItemAnnotation + */ + protected void addItemAnnotation(ItemAnnotation ia) { + annotations.put("" + ia.getId(), ia); + } + /** + * deletes all Attachments of this Item + * + */ + protected void deleteAllAttachments() { attachments.clear(); } + + /** + * deletes the given ItemAttachment + * @param ia - ItemAttachment to be deleted + */ + public void removeItemAttachment(ItemAttachment ia) { + attachments.remove("" + ia.getId()); + } + } \ No newline at end of file |