org.openstreetmap.josm.gui.tagging.ac
Class AutoCompletionListItem

java.lang.Object
  extended by org.openstreetmap.josm.gui.tagging.ac.AutoCompletionListItem
All Implemented Interfaces:
java.lang.Comparable<AutoCompletionListItem>

public class AutoCompletionListItem
extends java.lang.Object
implements java.lang.Comparable<AutoCompletionListItem>

Represents an entry in the list of auto completion values. An AutoCompletionListItem has a priority and a value. The priority helps to sort the auto completion items according to their importance. For instance, in an auto completion list for tag names, standard tag names would be assigned a higher priority than arbitrary tag names present in the current data set. There are three priority levels, AutoCompletionItemPritority. The value is a string which will be displayed in the auto completion list.


Field Summary
private  AutoCompletionItemPritority priority
          the pritority of this item
private  java.lang.String value
          the value of this item
 
Constructor Summary
AutoCompletionListItem()
           
AutoCompletionListItem(java.lang.String value)
           
AutoCompletionListItem(java.lang.String value, AutoCompletionItemPritority priority)
          constructor
 
Method Summary
 int compareTo(AutoCompletionListItem other)
           
 boolean equals(java.lang.Object obj)
           
 AutoCompletionItemPritority getPriority()
           
 java.lang.String getValue()
           
 int hashCode()
           
 void setPriority(AutoCompletionItemPritority priority)
          sets the priority
 void setValue(java.lang.String value)
          sets the value
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

priority

private AutoCompletionItemPritority priority
the pritority of this item


value

private java.lang.String value
the value of this item

Constructor Detail

AutoCompletionListItem

public AutoCompletionListItem(java.lang.String value,
                              AutoCompletionItemPritority priority)
constructor


AutoCompletionListItem

public AutoCompletionListItem(java.lang.String value)

AutoCompletionListItem

public AutoCompletionListItem()
Method Detail

getPriority

public AutoCompletionItemPritority getPriority()
Returns:
the priority

setPriority

public void setPriority(AutoCompletionItemPritority priority)
sets the priority

Parameters:
priority - the priority

getValue

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

setValue

public void setValue(java.lang.String value)
sets the value

Parameters:
value - the value; must not be null
Throws:
java.lang.IllegalArgumentException - thrown, if value if null

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(AutoCompletionListItem other)
Specified by:
compareTo in interface java.lang.Comparable<AutoCompletionListItem>


JOSM