Class TagModel
- java.lang.Object
-
- org.openstreetmap.josm.gui.tagging.TagModel
-
public class TagModel extends java.lang.Object
Tag model.- Since:
- 1762
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValue(java.lang.String value)adds a tag valuevoidclearValues()removes all values from the list of valuesjava.lang.StringgetName()returns the tag name (key).java.lang.StringgetValue()returns the value(s) as stringintgetValueCount()returns the number of valuesjava.util.List<java.lang.String>getValues()returns the list of valuesbooleanhasValue(java.lang.String value)determines if this tag model has a specific valuevoidremoveValue(java.lang.String value)removes a value from the list of values.voidsetName(java.lang.String name)sets the name.voidsetValue(java.lang.String value)sets a unique value for this tag.java.lang.StringtoString()
-
-
-
Method Detail
-
setName
public final void setName(java.lang.String name)
sets the name. Converts name to "" if null.- Parameters:
name- the tag name
-
getName
public java.lang.String getName()
returns the tag name (key).- Returns:
- the tag name
-
clearValues
public void clearValues()
removes all values from the list of values
-
setValue
public final void setValue(java.lang.String value)
sets a unique value for this tag. Converts value to "", if null.- Parameters:
value- the value.
-
hasValue
public boolean hasValue(java.lang.String value)
determines if this tag model has a specific value- Parameters:
value- the value to be checked; converted to "" if null- Returns:
- true, if the values of this tag include
value; false otherwise
-
addValue
public void addValue(java.lang.String value)
adds a tag value- Parameters:
value- the value to add; converted to "" if null
-
removeValue
public void removeValue(java.lang.String value)
removes a value from the list of values. Converts value to "" if null- Parameters:
value- the value
-
getValues
public java.util.List<java.lang.String> getValues()
returns the list of values- Returns:
- the list of values
-
getValue
public java.lang.String getValue()
returns the value(s) as string- Returns:
- the value(s) as string, joined with a semicolon (;) if multiple values
-
getValueCount
public int getValueCount()
returns the number of values- Returns:
- the number of values
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-