/** * Return a link object with the given id and details. If a link with the given id has already * been created in this session, update its data and return that, else create a new one, and add * it to the list. * * @param String sLinkID, the unique identifier for this Link. * @param java.util.Date dCreationDate, the date the Link was created. * @param java.util.Date dModificationDate, the date the link was last modified. * @param String sAuthor, the name of the porson who created this Link. * @param Stirng sType, the type of this link. * @param String sOriginalID, the original ID of this link if/when imported. * @param sLabel, the label for this Link. */ public static Link getLink( String sLinkID, java.util.Date dCreationDate, java.util.Date dModificationDate, String sAuthor, String sType, String sOriginalID, String sLabel) { int i = 0; for (i = 0; i < linkSummaryList.size(); i++) { if (sLinkID.equals(((Link) linkSummaryList.elementAt(i)).getId())) { break; } } Link link = null; if (i == linkSummaryList.size()) { link = new Link(sLinkID, dCreationDate, dModificationDate, sAuthor, sType, sOriginalID, sLabel); linkSummaryList.addElement(link); } else { link = (Link) linkSummaryList.elementAt(i); // UPDATE THE DETAILS link.setTypeLocal(sType); link.setAuthorLocal(sAuthor); link.setOriginalIDLocal(sOriginalID); link.setLabelLocal(sLabel); link.setCreationDateLocal(dCreationDate); link.setModificationDateLocal(dModificationDate); } return link; }
/** * Sets the original imported id of this object, in the local data ONLY. * * @param String sOriginalID, the original id of this object. */ public void setOriginalID(String sOriginalID) { if (this.sOriginalID.equals(sOriginalID)) return; setOriginalIDLocal(sOriginalID); }