/** * Override Object.hashCode() to implement equals. */ public int hashCode() { if (hashCode == 0) { int result = 17; if (null != getURI()) result = 37 * result + getURI().hashCode(); if (null != getInlineContent()) result = 37 * result + getInlineContent().hashCode(); if (null != getXlinkTitle()) result = 37 * result + getXlinkTitle().hashCode(); if (null != getType()) result = 37 * result + getType().hashCode(); hashCode = result; } return hashCode; }
/** * Construct from fields in XML catalog. * @param parent parent selector * @param name choice name - display to user * @param value choice value - send to server */ public ListChoice( Selector parent, String name, String value, String description) { this.parent = parent; this.name = name; this.value = value; if (description != null) { setDescription( new InvDocumentation(null, null, null, null, description)); } }
/** * string representation */ public String toString() { if (hasXlink()) return "<" + uri + "> <" + title + "> <" + type + ">" + ((content == null) ? "" : " <" + content + ">"); else return "<" + inlineContent + ">"; }
/** * get specific type of documentation * * @param type find this type of documentation * @return contents of documentation of specified type */ public String getDocumentation(String type) { for (InvDocumentation doc : getDocumentation()) { String dtype = doc.getType(); if ((dtype != null) && dtype.equalsIgnoreCase(type)) return doc.getInlineContent(); } return null; }
System.out.println(" threddsMD.getDocumentation() = " + documentation); for (InvDocumentation invDocumentation : documentation) { System.out.println(" invDocumentation.getInlineContent() = " + invDocumentation.getInlineContent()); System.out.println(" invDocumentation.getType() = " + invDocumentation.getType()); try { System.out.println(" invDocumentation.getXlinkContent() = " + invDocumentation.getXlinkContent()); } catch (IOException e) { Debug.trace(e); System.out.println(" invDocumentation.getXlinkHref() = " + invDocumentation.getXlinkHref()); System.out.println(" invDocumentation.getXlinkTitle() = " + invDocumentation.getXlinkTitle()); System.out.println(" invDocumentation.getURI() = " + invDocumentation.getURI());
/** * set specified type of documentation * * @param type type of documentation * @param content documentation contenet */ public void addDocumentation(String type, String content) { if (content == null) { removeDocumentation(type); return; } content = content.trim(); for (InvDocumentation doc : getDocumentation()) { String dtype = doc.getType(); if ((dtype != null) && dtype.equalsIgnoreCase(type)) { doc.setInlineContent(content); return; } } if (content.length() > 0) addDocumentation(new InvDocumentation(null, null, null, type, content)); }
/** * InvDocumentation elements with same values are equal. */ public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof InvDocumentation)) return false; return o.hashCode() == this.hashCode(); }
/** * remove all instances of specified type of documentation * @param type type of documentation */ public void removeDocumentation(String type) { Iterator iter = docs.iterator(); while (iter.hasNext()) { InvDocumentation doc = (InvDocumentation) iter.next(); String dtype = doc.getType(); if ((dtype != null) && dtype.equalsIgnoreCase(type)) iter.remove(); } }
InvDocumentation doc = new InvDocumentation(); String path = getPath(); if (!path.endsWith("/")) path = path + "/"; doc.setXlinkHref( "/thredds/modelInventory/"+path); doc.setXlinkTitle( "Available Inventory"); tm.addDocumentation( doc);
/** * @return specific type of documentation * @param type match on doc.getType() */ public String getDocumentation(String type) { for (InvDocumentation doc : getDocumentation()) { String dtype = doc.getType(); if ((dtype != null) && dtype.equalsIgnoreCase(type)) return doc.getInlineContent(); } return null; }
/** * set specified type of documentation * * @param type type of documentation * @param content documentation contenet */ public void addDocumentation(String type, String content) { if (content == null) { removeDocumentation(type); return; } content = content.trim(); for (InvDocumentation doc : getDocumentation()) { String dtype = doc.getType(); if ((dtype != null) && dtype.equalsIgnoreCase(type)) { doc.setInlineContent(content); return; } } if (content.length() > 0) addDocumentation(new InvDocumentation(null, null, null, type, content)); }
/** * InvDocumentation elements with same values are equal. */ public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof InvDocumentation)) return false; return o.hashCode() == this.hashCode(); }
/** * remove all instances of specified type of documentation * @param type type of documentation */ public void removeDocumentation(String type) { Iterator iter = docs.iterator(); while (iter.hasNext()) { InvDocumentation doc = (InvDocumentation) iter.next(); String dtype = doc.getType(); if ((dtype != null) && dtype.equalsIgnoreCase(type)) iter.remove(); } }
/** * Override Object.hashCode() to implement equals. */ public int hashCode() { if (hashCode == 0) { int result = 17; if (null != getURI()) result = 37 * result + getURI().hashCode(); if (null != getInlineContent()) result = 37 * result + getInlineContent().hashCode(); if (null != getXlinkTitle()) result = 37 * result + getXlinkTitle().hashCode(); if (null != getType()) result = 37 * result + getType().hashCode(); hashCode = result; } return hashCode; }
/** * @return specific type of documentation * @param type match on doc.getType() */ public String getDocumentation(String type) { for (InvDocumentation doc : getDocumentation()) { String dtype = doc.getType(); if ((dtype != null) && dtype.equalsIgnoreCase(type)) return doc.getInlineContent(); } return null; }
/** * set specified type of documentation * * @param type type of documentation * @param content documentation contenet */ public void addDocumentation(String type, String content) { if (content == null) { removeDocumentation(type); return; } content = content.trim(); for (InvDocumentation doc : getDocumentation()) { String dtype = doc.getType(); if ((dtype != null) && dtype.equalsIgnoreCase(type)) { doc.setInlineContent(content); return; } } if (content.length() > 0) addDocumentation(new InvDocumentation(null, null, null, type, content)); }
/** * Construct from fields in XML catalog. * @param parent parent selector * @param name choice name - display to user * @param value choice value - send to server */ public ListChoice( Selector parent, String name, String value, String description) { this.parent = parent; this.name = name; this.value = value; if (description != null) { setDescription( new InvDocumentation(null, null, null, null, description)); } }
/** * InvDocumentation elements with same values are equal. */ public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof InvDocumentation)) return false; return o.hashCode() == this.hashCode(); }
/** * remove all instances of specified type of documentation * @param type type of documentation */ public void removeDocumentation(String type) { Iterator iter = docs.iterator(); while (iter.hasNext()) { InvDocumentation doc = (InvDocumentation) iter.next(); String dtype = doc.getType(); if ((dtype != null) && dtype.equalsIgnoreCase(type)) iter.remove(); } }
/** * string representation */ public String toString() { if (hasXlink()) return "<" + uri + "> <" + title + "> <" + type + ">" + ((content == null) ? "" : " <" + content + ">"); else return "<" + inlineContent + ">"; }