Package com.tangosol.util
Class ConverterCollections.ConverterCollection<F,T>
java.lang.Object
com.tangosol.util.ConverterCollections.ConverterCollection<F,T>
- Type Parameters:
F- the type of elements in the underlying CollectionT- the type that the elements should be converted to
- All Implemented Interfaces:
Serializable,Iterable<T>,Collection<T>
- Direct Known Subclasses:
ConverterCollections.ConverterList,ConverterCollections.ConverterSet
- Enclosing class:
ConverterCollections
public static class ConverterCollections.ConverterCollection<F,T>
extends Object
implements Collection<T>, Serializable
A Converter Collection views an underlying Collection through a
Converter.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConverterCollection(Collection<F> col, Converter<F, T> convUp, Converter<T, F> convDown) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends T> col) voidclear()booleanbooleancontainsAll(Collection<?> col) booleanCompares the specified object with this collection for equality.Return the underlying Collection.Return the Converter used to pass values down to the underlying Collection.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.Create a Converter Iterator.voidDrop references to the underlying Collection and the Converters.booleanisEmpty()iterator()booleanbooleanremoveAll(Collection<?> col) booleanretainAll(Collection<?> col) intsize()Object[]toArray()<E> E[]toArray(E[] aoDest) toString()Return a String description for this collection.Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Field Details
-
m_col
The underlying Collection. -
m_convUp
The Converter from the underlying Collection to this Collection. -
m_convDown
The Converter from this Collection to the underlying Collection.
-
-
Constructor Details
-
ConverterCollection
Constructor.- Parameters:
col- the underlying CollectionconvUp- the Converter from the underlying CollectionconvDown- the Converter to the underlying Collection
-
-
Method Details
-
size
public int size()- Specified by:
sizein interfaceCollection<F>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<F>
-
contains
- Specified by:
containsin interfaceCollection<F>
-
iterator
-
toArray
- Specified by:
toArrayin interfaceCollection<F>
-
toArray
public <E> E[] toArray(E[] aoDest) - Specified by:
toArrayin interfaceCollection<F>
-
add
- Specified by:
addin interfaceCollection<F>
-
remove
- Specified by:
removein interfaceCollection<F>
-
containsAll
- Specified by:
containsAllin interfaceCollection<F>
-
addAll
- Specified by:
addAllin interfaceCollection<F>
-
removeAll
- Specified by:
removeAllin interfaceCollection<F>
-
retainAll
- Specified by:
retainAllin interfaceCollection<F>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<F>
-
equals
Compares the specified object with this collection for equality.Obeys the general contract of Collection.equals.
- Specified by:
equalsin interfaceCollection<F>- Overrides:
equalsin classObject- Parameters:
o- Object to be compared for equality with this Collection- Returns:
- true if the specified object is equal to this Collection
-
toString
Return a String description for this collection. -
invalidate
public void invalidate()Drop references to the underlying Collection and the Converters. -
instantiateCollection
protected <T,F> Collection<T> instantiateCollection(Collection<F> col, Converter<F, T> convUp, Converter<T, F> convDown) Create a Converter Collection.- Type Parameters:
T- the type that the elements should be converted toF- the type of elements in the underlying Collection- Parameters:
col- the underlying CollectionconvUp- the Converter to view the underlying Collection throughconvDown- the Converter to pass items down to the underlying Collection through- Returns:
- a Converter Collection
-
instantiateIterator
Create a Converter Iterator.- Parameters:
iter- the underlying Iteratorconv- the Converter to view the underlying Iterator through- Returns:
- a Converter Iterator
-
getCollection
Return the underlying Collection.- Returns:
- the underlying Collection
-
getConverterUp
Return the Converter used to view the underlying Collection's values through.- Returns:
- the Converter from the underlying Collection
-
getConverterDown
Return the Converter used to pass values down to the underlying Collection.- Returns:
- the Converter to the underlying Collection
-