org.openstreetmap.osmosis.core.domain.v0_5
Class Tag

java.lang.Object
  extended by org.openstreetmap.osmosis.core.domain.v0_5.Tag
All Implemented Interfaces:
java.lang.Comparable<Tag>, Storeable

public class Tag
extends java.lang.Object
implements java.lang.Comparable<Tag>, Storeable

A data class representing a single OSM tag.

Author:
Brett Henderson

Constructor Summary
Tag(StoreReader sr, StoreClassRegister scr)
          Creates a new instance.
Tag(java.lang.String key, java.lang.String value)
          Creates a new instance.
 
Method Summary
 int compareTo(Tag tag)
          Compares this tag to the specified tag.
 java.lang.String getKey()
           
 java.lang.String getValue()
           
 void store(StoreWriter sw, StoreClassRegister scr)
          Stores all state to the specified store writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tag

public Tag(java.lang.String key,
           java.lang.String value)
Creates a new instance.

Parameters:
key - The key identifying the tag.
value - The value associated with the tag.

Tag

public Tag(StoreReader sr,
           StoreClassRegister scr)
Creates a new instance.

Parameters:
sr - The store to read state from.
scr - Maintains the mapping between classes and their identifiers within the store.
Method Detail

store

public void store(StoreWriter sw,
                  StoreClassRegister scr)
Stores all state to the specified store writer.

Specified by:
store in interface Storeable
Parameters:
sw - The writer that persists data to an underlying store.
scr - Maintains the mapping between classes and their identifiers within the store.

compareTo

public int compareTo(Tag tag)
Compares this tag to the specified tag. The tag comparison is based on a comparison of key and value in that order.

Specified by:
compareTo in interface java.lang.Comparable<Tag>
Parameters:
tag - The tag to compare to.
Returns:
0 if equal, < 0 if considered "smaller", and > 0 if considered "bigger".

getKey

public java.lang.String getKey()
Returns:
The key.

getValue

public java.lang.String getValue()
Returns:
The value.