F - the type of elements in the underlying CollectionT - the type that the elements should be converted topublic static class ConverterCollections.ConverterCollection<F,T> extends Object implements Collection<T>, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected Collection<F> |
m_col
The underlying Collection.
|
protected Converter<T,F> |
m_convDown
The Converter from this Collection to the underlying Collection.
|
protected Converter<F,T> |
m_convUp
The Converter from the underlying Collection to this Collection.
|
| Constructor and Description |
|---|
ConverterCollection(Collection<F> col,
Converter<F,T> convUp,
Converter<T,F> convDown)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T o) |
boolean |
addAll(Collection<? extends T> col) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> col) |
boolean |
equals(Object o)
Compares the specified object with this collection for equality.
|
Collection<F> |
getCollection()
Return the underlying Collection.
|
Converter<T,F> |
getConverterDown()
Return the Converter used to pass values down to the underlying
Collection.
|
Converter<F,T> |
getConverterUp()
Return the Converter used to view the underlying Collection's
values through.
|
protected <T,F> Collection<T> |
instantiateCollection(Collection<F> col,
Converter<F,T> convUp,
Converter<T,F> convDown)
Create a Converter Collection.
|
protected Iterator<T> |
instantiateIterator(Iterator<F> iter,
Converter<F,T> conv)
Create a Converter Iterator.
|
void |
invalidate()
Drop references to the underlying Collection and the Converters.
|
boolean |
isEmpty() |
Iterator<T> |
iterator() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> col) |
boolean |
retainAll(Collection<?> col) |
int |
size() |
Object[] |
toArray() |
<E> E[] |
toArray(E[] aoDest) |
String |
toString()
Return a String description for this collection.
|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waithashCode, parallelStream, removeIf, spliterator, streamprotected Collection<F> m_col
protected Converter<F,T> m_convUp
public int size()
size in interface Collection<T>public boolean isEmpty()
isEmpty in interface Collection<T>public boolean contains(Object o)
contains in interface Collection<T>public Object[] toArray()
toArray in interface Collection<T>public <E> E[] toArray(E[] aoDest)
toArray in interface Collection<T>public boolean add(T o)
add in interface Collection<T>public boolean remove(Object o)
remove in interface Collection<T>public boolean containsAll(Collection<?> col)
containsAll in interface Collection<T>public boolean addAll(Collection<? extends T> col)
addAll in interface Collection<T>public boolean removeAll(Collection<?> col)
removeAll in interface Collection<T>public boolean retainAll(Collection<?> col)
retainAll in interface Collection<T>public void clear()
clear in interface Collection<T>public boolean equals(Object o)
Obeys the general contract of Collection.equals.
equals in interface Collection<T>equals in class Objecto - Object to be compared for equality with this Collectionpublic String toString()
public void invalidate()
protected <T,F> Collection<T> instantiateCollection(Collection<F> col, Converter<F,T> convUp, Converter<T,F> convDown)
F - the type of elements in the underlying CollectionT - the type that the elements should be converted tocol - the underlying CollectionconvUp - the Converter to view the underlying Collection
throughconvDown - the Converter to pass items down to the underlying
Collection throughprotected Iterator<T> instantiateIterator(Iterator<F> iter, Converter<F,T> conv)
iter - the underlying Iteratorconv - the Converter to view the underlying Iterator throughpublic Collection<F> getCollection()
public Converter<F,T> getConverterUp()