Package com.terracottatech.store
Class KeyedCellCollection.Detached<K extends Comparable<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.Detached<K extends Comparable<K>>
extends AbstractCollection<Cell<?>>
implements KeyedCellCollection<K>
An isolated (from any dataset) keyed cell collection.
-
Nested Class Summary
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_NAMEFields inherited from interface com.terracottatech.store.KeyedCellCollection
DEPRECATED_KEY_FIELD_NAME, KEY_FIELD_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieve a cell by name.booleanbooleanIndicates whether some object is equal to thisKeyedCellCollection.<T> Optional<T>get(CellDefinition<T> cellDefinition) Retrieve a cell byCellDefinition.Optional<?>Retrieve a cell by name.getKey()Returns the key for this collection.inthashCode()Returns a hash code value for this collection.iterator()intsize()Spliterator<Cell<?>>toString()Methods inherited from class java.util.AbstractCollection
add, addAll, clear, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArrayMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
add, addAll, clear, containsAll, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, stream, toArray, toArray, toArrayMethods inherited from interface com.terracottatech.store.KeyedCellCollection
asStoreMap, subset, subset
-
Constructor Details
-
Detached
Create a keyed cell collection with given key and cells.- Parameters:
key- the collection keycells- the contained cells
-
-
Method Details
-
getKey
Description copied from interface:KeyedCellCollectionReturns the key for this collection.- Specified by:
getKeyin interfaceKeyedCellCollection<K extends Comparable<K>>- Returns:
- the collection key
-
iterator
- Specified by:
iteratorin interfaceCollection<K extends Comparable<K>>- Specified by:
iteratorin interfaceIterable<K extends Comparable<K>>- Specified by:
iteratorin classAbstractCollection<Cell<?>>
-
size
public int size()- Specified by:
sizein interfaceCollection<K extends Comparable<K>>- Specified by:
sizein classAbstractCollection<Cell<?>>
-
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
-
contains
- Specified by:
containsin interfaceCollection<K extends Comparable<K>>- Overrides:
containsin classAbstractCollection<Cell<?>>
-
toString
- Overrides:
toStringin classAbstractCollection<Cell<?>>
-
hashCode
public int hashCode()Description copied from interface:KeyedCellCollectionReturns a hash code value for this collection.While conforming to the general contract established for
Object.hashCode, in concert with#equals, implementations forKeyedCellCollectionsubclasses will consider the value forgetKeyand the cells contained in this instance.- Specified by:
hashCodein interfaceCollection<K extends Comparable<K>>- Specified by:
hashCodein interfaceKeyedCellCollection<K extends Comparable<K>>- Overrides:
hashCodein classObject- Returns:
- a hash code for this instance.
- See Also:
-
equals
Description copied from interface:KeyedCellCollectionIndicates whether some object is equal to thisKeyedCellCollection.While conforming to the general contract established for
Object.equals, implementations forKeyedCellCollectionsubclasses will consider the value forgetKeyand the cells contained in this instance.- Specified by:
equalsin interfaceCollection<K extends Comparable<K>>- Specified by:
equalsin interfaceKeyedCellCollection<K extends Comparable<K>>- Overrides:
equalsin classObject- See Also:
-
spliterator
- Specified by:
spliteratorin interfaceCollection<K extends Comparable<K>>- Specified by:
spliteratorin interfaceIterable<K extends Comparable<K>>
-