Class AutoCompletionSet
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- java.util.TreeSet<AutoCompletionItem>
-
- org.openstreetmap.josm.data.tagging.ac.AutoCompletionSet
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<AutoCompletionItem>
,Collection<AutoCompletionItem>
,NavigableSet<AutoCompletionItem>
,Set<AutoCompletionItem>
,SortedSet<AutoCompletionItem>
public class AutoCompletionSet extends TreeSet<AutoCompletionItem>
A sorted set ofAutoCompletionItem
s. Items are sorted with higher priority first, then according to lexicographic order on the value of theAutoCompletionListItem
.- Since:
- 12859 (extracted from
gui.tagging.ac.AutoCompletionList
) - See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
private Set<String>
values
-
Constructor Summary
Constructors Constructor Description AutoCompletionSet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(AutoCompletionItem e)
boolean
addAll(Collection<String> values, AutoCompletionPriority priority)
Adds a list of strings to this list.boolean
addUserInput(Collection<String> values)
Adds values that have been entered by the user.void
clear()
boolean
contains(String value)
Checks whether an item with the given value is already in the list.boolean
remove(Object o)
boolean
remove(String key)
Removes the auto completion item with keykey
-
Methods inherited from class java.util.TreeSet
addAll, ceiling, clone, comparator, contains, descendingIterator, descendingSet, first, floor, headSet, headSet, higher, isEmpty, iterator, last, lower, pollFirst, pollLast, size, spliterator, subSet, subSet, tailSet, tailSet
-
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
-
Methods inherited from class java.util.AbstractCollection
containsAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AutoCompletionSet
public AutoCompletionSet()
-
-
Method Detail
-
add
public boolean add(AutoCompletionItem e)
- Specified by:
add
in interfaceCollection<AutoCompletionItem>
- Specified by:
add
in interfaceSet<AutoCompletionItem>
- Overrides:
add
in classTreeSet<AutoCompletionItem>
-
remove
public boolean remove(Object o)
- Specified by:
remove
in interfaceCollection<AutoCompletionItem>
- Specified by:
remove
in interfaceSet<AutoCompletionItem>
- Overrides:
remove
in classTreeSet<AutoCompletionItem>
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<AutoCompletionItem>
- Specified by:
clear
in interfaceSet<AutoCompletionItem>
- Overrides:
clear
in classTreeSet<AutoCompletionItem>
-
addAll
public boolean addAll(Collection<String> values, AutoCompletionPriority priority)
Adds a list of strings to this list. Only strings which are not null and which do not exist yet in the list are added.- Parameters:
values
- a list of strings to addpriority
- the priority to use- Returns:
true
if this set changed as a result of the call
-
addUserInput
public boolean addUserInput(Collection<String> values)
Adds values that have been entered by the user.- Parameters:
values
- values that have been entered by the user- Returns:
true
if this set changed as a result of the call
-
contains
public boolean contains(String value)
Checks whether an item with the given value is already in the list. Ignores priority of the items.- Parameters:
value
- the value of an auto completion item- Returns:
- true, if value is in the list; false, otherwise
-
-