Class OneClickList
java.lang.Object
com.illumon.iris.gui.util.oneclick.OneClickList
- All Implemented Interfaces:
Comparable<OneClickList>
,Iterable<String>
public class OneClickList extends Object implements Iterable<String>, Comparable<OneClickList>
-
Constructor Summary
Constructors Constructor Description OneClickList(String name)
OneClickList(String name, Collection<String> values)
-
Method Summary
Modifier and Type Method Description void
add(String item)
Add an item to the list.protected void
addAll(Collection<String> other)
void
clear()
int
compareTo(OneClickList other)
Sorts OneClickLists by pinned (first), then by name.boolean
containsAll(Collection<String> other)
boolean
getIsPinned()
boolean
getIsSorted()
boolean
getIsUppercase()
Collection<String>
getItems()
Collection<String>
getItemsCopy()
String
getName()
boolean
isEmpty()
Iterator<String>
iterator()
protected void
setIsUppercase(boolean value)
Set uppercase enforcement.protected void
setName(String name)
protected void
setPinned(boolean value)
protected void
setSorted(boolean value)
Set the sorting state of the list.String
toString()
-
Constructor Details
-
Method Details
-
getIsPinned
public boolean getIsPinned() -
setPinned
protected void setPinned(boolean value) -
getIsSorted
public boolean getIsSorted() -
setSorted
protected void setSorted(boolean value)Set the sorting state of the list. When this transitions from false to true the internal list will be sorted. -
getIsUppercase
public boolean getIsUppercase() -
setIsUppercase
protected void setIsUppercase(boolean value)Set uppercase enforcement. When this value is set to true, the internal collection will NOT be modified, but any item inserted withadd()
will uppercase the input. -
getItems
-
getItemsCopy
-
getName
-
setName
-
clear
public void clear() -
containsAll
-
addAll
-
add
Add an item to the list. If the list is set as uppercase enforcing, it will uppercase the input. If the list is set as sorted, it will insert the item in the correct place to maintain the sort. If the item already exists, it will not be added again.- Parameters:
item
- The item to insert.
-
isEmpty
public boolean isEmpty() -
iterator
-
compareTo
Sorts OneClickLists by pinned (first), then by name.- Specified by:
compareTo
in interfaceComparable<OneClickList>
-
toString
-