Package com.terracottatech.store
Class CellCollection.SubsetView
- All Implemented Interfaces:
CellCollection,Iterable<Cell<?>>,Collection<Cell<?>>
- Direct Known Subclasses:
KeyedCellCollection.SubsetView
- Enclosing interface:
- CellCollection
public static class CellCollection.SubsetView
extends AbstractCollection<Cell<?>>
implements CellCollection
A subset view of a cell collection.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.terracottatech.store.CellCollection
CellCollection.SubsetView -
Field Summary
Fields inherited from interface com.terracottatech.store.CellCollection
CELLS_FIELD_NAME, DEPRECATED_CELLS_FIELD_NAME -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSubsetView(CellCollection of, Set<CellDefinition<?>> definitions) Creates a subset view of the given collection showing only the given cells -
Method Summary
Modifier and TypeMethodDescriptionRetrieve a cell by name.protected Set<CellDefinition<?>>The cell definitions this view selects.boolean<T> Optional<T>get(CellDefinition<T> cellDefinition) Retrieve a cell byCellDefinition.Optional<?>Retrieve a cell by name.inthashCode()iterator()intsize()Spliterator<Cell<?>>stream()subset(Set<CellDefinition<?>> definitions) Retrieve a subset of cells by their definitions.Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.terracottatech.store.CellCollection
asStoreMap, subsetMethods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, toArray, toArray, toArray
-
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
-
definitions
The cell definitions this view selects.- Returns:
- the selected cell definitions
-
subset
Description copied from interface:CellCollectionRetrieve 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:
subsetin interfaceCellCollection- Parameters:
definitions- cells to retrieve- Returns:
- a view of a subset of this collection
-
get
Description copied from interface:CellCollectionRetrieve a cell byCellDefinition. If this record contains a cell whose definition matches the supplied definition (in both name and type) then that cell's value is wrapped in anOptionaland returned. If this record contains no matching cell then an emptyOptionalis returned.- Specified by:
getin interfaceCellCollection- Type Parameters:
T- the cell JDK type- Parameters:
cellDefinition- cell to retrieve- Returns:
- An
Optionalwith the cell value or an emptyOptionalif the record contains no matching cell
-
get
Description copied from interface:CellCollectionRetrieve a cell by name. If this record contains a cell whose definition matches the supplied name then that cell's value is wrapped in anOptionaland returned. If this record contains no matching cell then an emptyOptionalis returned.- Specified by:
getin interfaceCellCollection- Parameters:
name- cell to retrieve- Returns:
- An
Optionalwith the cell value or an emptyOptionalif the record contains no matching cell
-
cell
Description copied from interface:CellCollectionRetrieve a cell by name. If this record contains a cell whose definition matches the supplied name then the cell is wrapped in anOptionaland returned. If this record contains no matching cell then an emptyOptionalis returned.- Specified by:
cellin interfaceCellCollection- Parameters:
name- cell to retrieve- Returns:
- An
Optionalwith the cell or an emptyOptionalif the record contains no matching cell
-
spliterator
- Specified by:
spliteratorin interfaceCollection<Cell<?>>- Specified by:
spliteratorin interfaceIterable<Cell<?>>
-
stream
- Specified by:
streamin interfaceCollection<Cell<?>>
-
iterator
- Specified by:
iteratorin interfaceCollection<Cell<?>>- Specified by:
iteratorin interfaceIterable<Cell<?>>- Specified by:
iteratorin classAbstractCollection<Cell<?>>
-
size
public int size()- Specified by:
sizein interfaceCollection<Cell<?>>- Specified by:
sizein classAbstractCollection<Cell<?>>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<Cell<?>>- Overrides:
hashCodein classObject
-
equals
- Specified by:
equalsin interfaceCollection<Cell<?>>- Overrides:
equalsin classObject
-