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:
com.tangosol.internal.tracing.TracingAware
,Serializable
,Iterable<T>
,Collection<T>
- Direct Known Subclasses:
ConverterCollections.ConverterList
,ConverterCollections.ConverterQueue
,ConverterCollections.ConverterSet
- Enclosing class:
ConverterCollections
public static class ConverterCollections.ConverterCollection<F,T>
extends Object
implements Collection<T>, Serializable, com.tangosol.internal.tracing.TracingAware
A Converter Collection views an underlying Collection through a
Converter.
- Author:
- cp 2002.02.08, jh 2007.09.28
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Collection
<F> The underlying Collection.The Converter from this Collection to the underlying Collection.The Converter from the underlying Collection to this Collection.protected com.tangosol.internal.tracing.Span
The parentSpan
, if any.protected String
The name of the parentSpan
. -
Constructor Summary
ConstructorsConstructorDescriptionConverterCollection
(Collection<F> col, Converter<F, T> convUp, Converter<T, F> convDown) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends T> col) void
clear()
boolean
boolean
containsAll
(Collection<?> col) boolean
Compares 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.void
Drop references to the underlying Collection and the Converters.boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> col) boolean
retainAll
(Collection<?> col) void
setParentSpan
(String sSpanName, com.tangosol.internal.tracing.Span spanParent) Sets the parent span name and span that the implementing component may use to build the span graph.int
size()
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, wait
Methods inherited from interface java.util.Collection
hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Field Details
-
m_col
The underlying Collection. -
m_convUp
-
m_convDown
-
m_spanParent
protected com.tangosol.internal.tracing.Span m_spanParentThe parentSpan
, if any.- Since:
- 15.1.1.0
-
m_sSpanName
-
-
Constructor Details
-
ConverterCollection
-
-
Method Details
-
setParentSpan
Description copied from interface:com.tangosol.internal.tracing.TracingAware
Sets the parent span name and span that the implementing component may use to build the span graph.- Specified by:
setParentSpan
in interfacecom.tangosol.internal.tracing.TracingAware
- Parameters:
sSpanName
- the parentSpan
namespanParent
- the parentSpan
-
size
public int size()- Specified by:
size
in interfaceCollection<F>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<F>
-
contains
- Specified by:
contains
in interfaceCollection<F>
-
iterator
-
toArray
- Specified by:
toArray
in interfaceCollection<F>
-
toArray
public <E> E[] toArray(E[] aoDest) - Specified by:
toArray
in interfaceCollection<F>
-
add
- Specified by:
add
in interfaceCollection<F>
-
remove
- Specified by:
remove
in interfaceCollection<F>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<F>
-
addAll
- Specified by:
addAll
in interfaceCollection<F>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<F>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<F>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<F>
-
equals
Compares the specified object with this collection for equality.Obeys the general contract of Collection.equals.
- Specified by:
equals
in interfaceCollection<F>
- Overrides:
equals
in classObject
- Parameters:
o
- Object to be compared for equality with this Collection- Returns:
- true if the specified object is equal to this Collection
-
toString
-
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
-
getCollection
Return the underlying Collection.- Returns:
- the underlying Collection
-
getConverterUp
-
getConverterDown
-