class ConverterSet
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ConverterSet.Entry |
Modifier and Type | Field and Description |
---|---|
private Converter[] |
iConverters |
private ConverterSet.Entry[] |
iSelectEntries |
Constructor and Description |
---|
ConverterSet(Converter[] converters) |
Modifier and Type | Method and Description |
---|---|
(package private) ConverterSet |
add(Converter converter,
Converter[] removed)
Returns a copy of this set, with the given converter added.
|
(package private) void |
copyInto(Converter[] converters)
Copies all the converters in the set to the given array.
|
(package private) ConverterSet |
remove(Converter converter,
Converter[] removed)
Returns a copy of this set, with the given converter removed.
|
(package private) ConverterSet |
remove(int index,
Converter[] removed)
Returns a copy of this set, with the converter at the given index
removed.
|
(package private) Converter |
select(java.lang.Class<?> type)
Returns the closest matching converter for the given type, or null if
none found.
|
private static Converter |
selectSlow(ConverterSet set,
java.lang.Class<?> type)
Returns the closest matching converter for the given type, but not very
efficiently.
|
(package private) int |
size()
Returns the amount of converters in the set.
|
private final Converter[] iConverters
private ConverterSet.Entry[] iSelectEntries
ConverterSet(Converter[] converters)
Converter select(java.lang.Class<?> type) throws java.lang.IllegalStateException
type
- type to select, which may be nulljava.lang.IllegalStateException
- if multiple converters match the type
equally wellint size()
void copyInto(Converter[] converters)
ConverterSet add(Converter converter, Converter[] removed)
converter
- converter to add, must not be nullremoved
- if not null, element 0 is set to the removed converterjava.lang.NullPointerException
- if converter is nullConverterSet remove(Converter converter, Converter[] removed)
converter
- converter to remove, must not be nullremoved
- if not null, element 0 is set to the removed converterjava.lang.NullPointerException
- if converter is nullConverterSet remove(int index, Converter[] removed)
index
- index of converter to removeremoved
- if not null, element 0 is set to the removed converterjava.lang.IndexOutOfBoundsException
- if the index is invalidprivate static Converter selectSlow(ConverterSet set, java.lang.Class<?> type)