Package com.tangosol.util
Class ConverterCollections.ConverterEntrySet<FK,TK,FV,TV>
- java.lang.Object
-
- com.tangosol.util.ConverterCollections.ConverterEntrySet<FK,TK,FV,TV>
-
- Type Parameters:
FK
- the type of the keys in the underlying EntrySetTK
- the type that the keys should be converted toFV
- the type of the values in the underlying EntrySetTV
- the type that the values should be converted to
- All Implemented Interfaces:
Serializable
,Iterable<Map.Entry<TK,TV>>
,Collection<Map.Entry<TK,TV>>
,Set<Map.Entry<TK,TV>>
- Enclosing class:
- ConverterCollections
public static class ConverterCollections.ConverterEntrySet<FK,TK,FV,TV> extends Object implements Set<Map.Entry<TK,TV>>, Serializable
A Converter Entry Set views an underlying Entry Set through a set of key and value Converters.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
ConverterCollections.ConverterEntrySet.ConverterEntry
A Map Entry that lazily converts the key and value.protected class
ConverterCollections.ConverterEntrySet.ConverterIterator
A Map Entry Iterator that converts the key and value types.
-
Field Summary
Fields Modifier and Type Field Description protected Converter<TK,FK>
m_convKeyDown
The Converter used to pass keys down to the Entry Set.protected Converter<FK,TK>
m_convKeyUp
The Converter used to view keys stored in the Entry Set.protected Converter<TV,FV>
m_convValDown
The Converter used to pass values down to the Entry Set.protected Converter<FV,TV>
m_convValUp
The Converter used to view values stored in the Entry Set.protected Collection<Map.Entry<FK,FV>>
m_set
The underlying Entry Set (or Collection of Map Entry objects).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(Map.Entry<TK,TV> o)
boolean
addAll(Collection<? extends Map.Entry<TK,TV>> col)
void
clear()
boolean
contains(Object o)
boolean
containsAll(Collection<?> col)
boolean
equals(Object o)
Converter<TK,FK>
getConverterKeyDown()
Return the Converter used to pass keys down to the underlying Entry Set.Converter<FK,TK>
getConverterKeyUp()
Return the Converter used to view the underlying Entry Set's keys through.Converter<TV,FV>
getConverterValueDown()
Return the Converter used to pass values down to the underlying Entry Set.Converter<FV,TV>
getConverterValueUp()
Return the Converter used to view the underlying Entry Set's values through.Collection<Map.Entry<FK,FV>>
getEntrySet()
Return the underlying Entry Set.int
hashCode()
protected <FK,FV,TK,TV>
Set<Map.Entry<TK,TV>>instantiateEntrySet(Collection<Map.Entry<FK,FV>> col, Converter<FK,TK> convKeyUp, Converter<TK,FK> convKeyDown, Converter<FV,TV> convValUp, Converter<TV,FV> convValDown)
Create a Converter Entry Set.boolean
isEmpty()
Iterator<Map.Entry<TK,TV>>
iterator()
boolean
remove(Object o)
boolean
removeAll(Collection<?> col)
boolean
retainAll(Collection<?> col)
int
size()
Object[]
toArray()
<T> T[]
toArray(T[] ao)
String
toString()
protected Map.Entry<TK,TV>
wrapEntry(Map.Entry<FK,FV> entry)
Wrap an Entry from the Entry Set to make a Converter Entry.protected Iterator<Map.Entry<TK,TV>>
wrapIterator(Iterator<Map.Entry<FK,FV>> iter)
Wrap an Iterator from the Entry Set to make a Converter Iterator.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.Set
spliterator
-
-
-
-
Field Detail
-
m_set
protected final Collection<Map.Entry<FK,FV>> m_set
The underlying Entry Set (or Collection of Map Entry objects).
-
m_convKeyUp
protected final Converter<FK,TK> m_convKeyUp
The Converter used to view keys stored in the Entry Set.
-
m_convKeyDown
protected final Converter<TK,FK> m_convKeyDown
The Converter used to pass keys down to the Entry Set.
-
m_convValUp
protected final Converter<FV,TV> m_convValUp
The Converter used to view values stored in the Entry Set.
-
-
Constructor Detail
-
ConverterEntrySet
public ConverterEntrySet(Collection<Map.Entry<FK,FV>> set, Converter<FK,TK> convKeyUp, Converter<TK,FK> convKeyDown, Converter<FV,TV> convValUp, Converter<TV,FV> convValDown)
Constructor.- Parameters:
set
- the underlying Entry Set (or Collection of Map Entry objects)convKeyUp
- the Converter to view the underlying Entry Set's keys throughconvKeyDown
- the Converter to use to pass keys down to the underlying Entry SetconvValUp
- the Converter to view the underlying Entry Set's values throughconvValDown
- the Converter to use to pass values down to the underlying Entry Set
-
-
Method Detail
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(Object o)
-
toArray
public Object[] toArray()
-
toArray
public <T> T[] toArray(T[] ao)
-
remove
public boolean remove(Object o)
-
containsAll
public boolean containsAll(Collection<?> col)
- Specified by:
containsAll
in interfaceCollection<FK>
- Specified by:
containsAll
in interfaceSet<FK>
-
addAll
public boolean addAll(Collection<? extends Map.Entry<TK,TV>> col)
-
removeAll
public boolean removeAll(Collection<?> col)
-
retainAll
public boolean retainAll(Collection<?> col)
-
clear
public void clear()
-
equals
public boolean equals(Object o)
-
hashCode
public int hashCode()
-
instantiateEntrySet
protected <FK,FV,TK,TV> Set<Map.Entry<TK,TV>> instantiateEntrySet(Collection<Map.Entry<FK,FV>> col, Converter<FK,TK> convKeyUp, Converter<TK,FK> convKeyDown, Converter<FV,TV> convValUp, Converter<TV,FV> convValDown)
Create a Converter Entry Set.- Type Parameters:
FK
- the type of the keys in the underlying EntrySetTK
- the type that the keys should be converted toFV
- the type of the values in the underlying EntrySetTV
- the type that the values should be converted to- Parameters:
col
- the underlying Collection of Map Entry objectsconvKeyUp
- the Converter to view the underlying Map's Entry Set's keys throughconvKeyDown
- the Converter to use to pass keys down to the underlying Map's Entry SetconvValUp
- the Converter to view the underlying Map's Entry Set's values throughconvValDown
- the Converter to use to pass values down to the underlying Map's Entry Set- Returns:
- a Converter Entry Set
-
wrapEntry
protected Map.Entry<TK,TV> wrapEntry(Map.Entry<FK,FV> entry)
Wrap an Entry from the Entry Set to make a Converter Entry.- Parameters:
entry
- a Map Entry to wrap- Returns:
- a Map Entry that restricts its type
-
wrapIterator
protected Iterator<Map.Entry<TK,TV>> wrapIterator(Iterator<Map.Entry<FK,FV>> iter)
Wrap an Iterator from the Entry Set to make a Converter Iterator.- Parameters:
iter
- a Iterator to wrap- Returns:
- a Converter Iterator
-
getEntrySet
public Collection<Map.Entry<FK,FV>> getEntrySet()
Return the underlying Entry Set.- Returns:
- the underlying Entry Set
-
getConverterKeyUp
public Converter<FK,TK> getConverterKeyUp()
Return the Converter used to view the underlying Entry Set's keys through.- Returns:
- the Converter from the underlying Entry Set's keys
-
getConverterKeyDown
public Converter<TK,FK> getConverterKeyDown()
Return the Converter used to pass keys down to the underlying Entry Set.- Returns:
- the Converter to the underlying Entry Set's keys
-
getConverterValueUp
public Converter<FV,TV> getConverterValueUp()
Return the Converter used to view the underlying Entry Set's values through.- Returns:
- the Converter from the underlying Entry Set's values
-
-