Package com.terracottatech.store
Class KeyedCellCollection.SubsetView<K extends Comparable<K>>
java.lang.Object
java.util.AbstractCollection<Cell<?>>
com.terracottatech.store.CellCollection.SubsetView
com.terracottatech.store.KeyedCellCollection.SubsetView<K>
- Type Parameters:
K
- the key type
- All Implemented Interfaces:
CellCollection
,KeyedCellCollection<K>
,Iterable<Cell<?>>
,Collection<Cell<?>>
- Enclosing interface:
- KeyedCellCollection<K extends Comparable<K>>
public static class KeyedCellCollection.SubsetView<K extends Comparable<K>>
extends CellCollection.SubsetView
implements KeyedCellCollection<K>
A subset view of a keyed cell collection.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.terracottatech.store.CellCollection
CellCollection.SubsetView
Nested classes/interfaces inherited from interface com.terracottatech.store.KeyedCellCollection
KeyedCellCollection.Detached<K extends Comparable<K>>, KeyedCellCollection.SubsetView<K extends Comparable<K>>
-
Field Summary
Fields inherited from interface com.terracottatech.store.CellCollection
CELLS_FIELD_NAME, DEPRECATED_CELLS_FIELD_NAME
Fields inherited from interface com.terracottatech.store.KeyedCellCollection
DEPRECATED_KEY_FIELD_NAME, KEY_FIELD_NAME
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SubsetView
(KeyedCellCollection<K> of, Set<CellDefinition<?>> definitions) Creates a subset view of the given collection showing only the given cells -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether some object is equal to thisKeyedCellCollection
.getKey()
Returns the key for this collection.int
hashCode()
Returns a hash code value for this collection.subset
(Set<CellDefinition<?>> definitions) Retrieve a subset of cells by their definitions.Methods inherited from class com.terracottatech.store.CellCollection.SubsetView
cell, definitions, get, get, iterator, size, spliterator, stream
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.terracottatech.store.CellCollection
cell, get, get
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
Methods inherited from interface com.terracottatech.store.KeyedCellCollection
asStoreMap, subset
-
Constructor Details
-
SubsetView
Creates a subset view of the given collection showing only the given cells- Parameters:
of
- the collection to viewdefinitions
- the cell definitions to select
-
-
Method Details
-
getKey
Description copied from interface:KeyedCellCollection
Returns the key for this collection.- Specified by:
getKey
in interfaceKeyedCellCollection<K extends Comparable<K>>
- Returns:
- the collection key
-
hashCode
public int hashCode()Description copied from interface:KeyedCellCollection
Returns a hash code value for this collection.While conforming to the general contract established for
Object.hashCode
, in concert with#equals
, implementations forKeyedCellCollection
subclasses will consider the value forgetKey
and the cells contained in this instance.- Specified by:
hashCode
in interfaceCollection<K extends Comparable<K>>
- Specified by:
hashCode
in interfaceKeyedCellCollection<K extends Comparable<K>>
- Overrides:
hashCode
in classCellCollection.SubsetView
- Returns:
- a hash code for this instance.
- See Also:
-
equals
Description copied from interface:KeyedCellCollection
Indicates whether some object is equal to thisKeyedCellCollection
.While conforming to the general contract established for
Object.equals
, implementations forKeyedCellCollection
subclasses will consider the value forgetKey
and the cells contained in this instance.- Specified by:
equals
in interfaceCollection<K extends Comparable<K>>
- Specified by:
equals
in interfaceKeyedCellCollection<K extends Comparable<K>>
- Overrides:
equals
in classCellCollection.SubsetView
- See Also:
-
subset
Description copied from interface:CellCollection
Retrieve a subset of cells by their definitions.The returned collection is a view. If this collection is mutable any mutations performed on this collection will be visible via the returned view.
- Specified by:
subset
in interfaceCellCollection
- Specified by:
subset
in interfaceKeyedCellCollection<K extends Comparable<K>>
- Overrides:
subset
in classCellCollection.SubsetView
- Parameters:
definitions
- cells to retrieve- Returns:
- a view of a subset of this collection
-