public class Options extends AbstractSet<OptionEntry> implements Cloneable, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Options.InsertPos |
Constructor and Description |
---|
Options() |
Options(OptionEntry[] entries) |
Options(Options other) |
Modifier and Type | Method and Description |
---|---|
void |
add(Object value,
String text,
boolean noCheck)
Adds an object, the check for an existing can be skipped for
performance issues (not recommended!)
|
boolean |
add(OptionEntry option) |
void |
addXml(Element element,
long flags)
Adds all these options to the xml element
|
void |
clear() |
Options |
clone() |
boolean |
contains(Object object) |
protected OptionEntry |
createOptionEntry(Object value,
String text) |
String |
get(Object value) |
OptionEntry |
getEntry(Object value) |
protected int |
getIndex(Object value) |
String |
getTextAt(int i)
Gets the text of the entry at index i
|
Object |
getValueAt(int i)
Gets the value of the entry at index i
|
Set<Object> |
getValues() |
boolean |
isEmpty() |
Iterator<OptionEntry> |
iterator() |
boolean |
remove(Object object) |
void |
set(Object value,
String text)
Sets or adds Adds an option at the bottom
|
void |
set(Object value,
String text,
Options.InsertPos pos)
Sets or Adds an option at a certain position
|
int |
size() |
Object[] |
toArray() |
String |
toString() |
equals, hashCode, removeAll
addAll, containsAll, retainAll, toArray
finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, containsAll, retainAll, toArray
public Options()
public Options(Options other)
public Options(OptionEntry[] entries)
protected int getIndex(Object value)
protected OptionEntry createOptionEntry(Object value, String text)
public OptionEntry getEntry(Object value)
public Object getValueAt(int i)
i
- the indexnull
if not foundpublic String getTextAt(int i)
i
- the indexpublic void set(Object value, String text, Options.InsertPos pos)
value
- the value objecttext
- the textpos
- the position, see Options.InsertPos
public void set(Object value, String text)
value
- the value objecttext
- the textpublic void add(Object value, String text, boolean noCheck)
value
- the valuetext
- the textnoCheck
- set to true to skip testing for an existing key (handle with care!)public boolean add(OptionEntry option)
add
in interface Collection<OptionEntry>
add
in interface Set<OptionEntry>
add
in class AbstractCollection<OptionEntry>
public void clear()
clear
in interface Collection<OptionEntry>
clear
in interface Set<OptionEntry>
clear
in class AbstractCollection<OptionEntry>
public boolean contains(Object object)
contains
in interface Collection<OptionEntry>
contains
in interface Set<OptionEntry>
contains
in class AbstractCollection<OptionEntry>
public boolean isEmpty()
isEmpty
in interface Collection<OptionEntry>
isEmpty
in interface Set<OptionEntry>
isEmpty
in class AbstractCollection<OptionEntry>
public Iterator<OptionEntry> iterator()
iterator
in interface Iterable<OptionEntry>
iterator
in interface Collection<OptionEntry>
iterator
in interface Set<OptionEntry>
iterator
in class AbstractCollection<OptionEntry>
public boolean remove(Object object)
remove
in interface Collection<OptionEntry>
remove
in interface Set<OptionEntry>
remove
in class AbstractCollection<OptionEntry>
public int size()
size
in interface Collection<OptionEntry>
size
in interface Set<OptionEntry>
size
in class AbstractCollection<OptionEntry>
public Object[] toArray()
toArray
in interface Collection<OptionEntry>
toArray
in interface Set<OptionEntry>
toArray
in class AbstractCollection<OptionEntry>
public String toString()
toString
in class AbstractCollection<OptionEntry>
public void addXml(Element element, long flags)
element
- the element to add the option tags toflags
- not used for nowCopyright © 2008–2015 Apache Software Foundation. All rights reserved.