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

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

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

Describes the priority of an item in an autocompletion list. The selected flag is currently only used in plugins. Instances of this class are not modifiable.


Field Summary
private  boolean inDataSet
           
private  boolean inStandard
           
static AutoCompletionItemPritority IS_IN_DATASET
          Indicates that this is an arbitrary value from the data set, i.e.
static AutoCompletionItemPritority IS_IN_SELECTION
          Indicates that this is a value from a selected object.
static AutoCompletionItemPritority IS_IN_STANDARD
          Indicates that this is a standard value, i.e.
static AutoCompletionItemPritority IS_IN_STANDARD_AND_IN_DATASET
          Indicates, that the value is standard and it is found in the data.
private  boolean selected
           
static AutoCompletionItemPritority UNKNOWN
          Unknown priority.
 
Constructor Summary
AutoCompletionItemPritority(boolean inDataSet, boolean inStandard, boolean selected)
           
 
Method Summary
 int compareTo(AutoCompletionItemPritority other)
          Imposes an ordering on the priorities.
 boolean isInDataSet()
           
 boolean isInStandard()
           
 boolean isSelected()
           
 AutoCompletionItemPritority mergeWith(AutoCompletionItemPritority other)
          Merges two priorities.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IS_IN_STANDARD_AND_IN_DATASET

public static final AutoCompletionItemPritority IS_IN_STANDARD_AND_IN_DATASET
Indicates, that the value is standard and it is found in the data. This has higher priority than some arbitrary standard value that is usually not used by the user.


IS_IN_DATASET

public static final AutoCompletionItemPritority IS_IN_DATASET
Indicates that this is an arbitrary value from the data set, i.e. the value of a tag name=*.


IS_IN_STANDARD

public static final AutoCompletionItemPritority IS_IN_STANDARD
Indicates that this is a standard value, i.e. a standard tag name or a standard value for a given tag name (from the presets).


IS_IN_SELECTION

public static final AutoCompletionItemPritority IS_IN_SELECTION
Indicates that this is a value from a selected object.


UNKNOWN

public static final AutoCompletionItemPritority UNKNOWN
Unknown priority. This is the lowest priority.


inDataSet

private final boolean inDataSet

inStandard

private final boolean inStandard

selected

private final boolean selected
Constructor Detail

AutoCompletionItemPritority

public AutoCompletionItemPritority(boolean inDataSet,
                                   boolean inStandard,
                                   boolean selected)
Method Detail

isInDataSet

public boolean isInDataSet()

isInStandard

public boolean isInStandard()

isSelected

public boolean isSelected()

compareTo

public int compareTo(AutoCompletionItemPritority other)
Imposes an ordering on the priorities. Currently, being in the current DataSet is worth more than being in the Presets.

Specified by:
compareTo in interface java.lang.Comparable<AutoCompletionItemPritority>

mergeWith

public AutoCompletionItemPritority mergeWith(AutoCompletionItemPritority other)
Merges two priorities. The resulting priority is always >= the original ones.


toString

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


JOSM