public class Tag extends java.lang.Object implements java.lang.Comparable<Tag>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID
CVS ID
|
Constructor and Description |
---|
Tag(long id)
Create a tag with the given database ID.
|
Tag(java.lang.String path)
Create a tag with the given path.
|
Tag(java.lang.String path,
long id)
Create a tag with the given path and database ID.
|
Modifier and Type | Method and Description |
---|---|
void |
addPolygon(java.awt.Polygon polygon)
Add a polygon to be associated with this Tag.
|
int |
compareTo(Tag tag)
Compares this tag to another for proper sorting of tag collections.
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getComment()
Get the comment for this tag.
|
long |
getId()
Returns the ID, which will be zero if the tag is not in the database
|
java.lang.String |
getName()
Return the name portion of this tag, with the leading path removed.
|
java.lang.String |
getPath()
Returns the PVL path of this tag.
|
java.util.List<java.awt.Polygon> |
getPolygons()
Get all the polygons that have been added.
|
java.lang.String |
getUsername()
Get the username.
|
void |
setComment(java.lang.String comment)
Set the comment for this tag.
|
void |
setId(long id)
Set the database ID, if known
|
void |
setUsername(java.lang.String username)
Override the default username, defined by the system property user.name.
|
java.lang.String |
toString()
Returns the string representation of a Tag, which is its PVL path.
|
public static final java.lang.String ID
public Tag(java.lang.String path)
path
- The PVL pathpublic Tag(long id)
id
- The database IDpublic Tag(java.lang.String path, long id)
id
- The database IDpublic void setComment(java.lang.String comment)
comment
- Text of commentpublic java.lang.String getComment()
public java.lang.String getUsername()
public void setUsername(java.lang.String username)
username
- New usernamepublic void addPolygon(java.awt.Polygon polygon)
polygon
- Points with x=sample, y=linepublic java.util.List<java.awt.Polygon> getPolygons()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getPath()
public java.lang.String getName()
public long getId()
public void setId(long id)
id
- index valuepublic int compareTo(Tag tag)
compareTo
in interface java.lang.Comparable<Tag>
tag
- anotherpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona