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 void
addValue(java.lang.String value)
adds a tag valuevoid
clearValues()
removes all values from the list of valuesjava.lang.String
getName()
returns the tag name (key).java.lang.String
getValue()
returns the value(s) as stringint
getValueCount()
returns the number of valuesjava.util.List<java.lang.String>
getValues()
returns the list of valuesboolean
hasValue(java.lang.String value)
determines if this tag model has a specific valuevoid
removeValue(java.lang.String value)
removes a value from the list of values.void
setName(java.lang.String name)
sets the name.void
setValue(java.lang.String value)
sets a unique value for this tag.java.lang.String
toString()
-
-
-
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:
toString
in classjava.lang.Object
-
-