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_NAME
Fields 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.boolean
boolean
Indicates 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.int
hashCode()
Returns a hash code value for this collection.iterator()
int
size()
Spliterator<Cell<?>>
toString()
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
add, addAll, clear, containsAll, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, stream, toArray, toArray, toArray
Methods 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:KeyedCellCollection
Returns the key for this collection.- Specified by:
getKey
in interfaceKeyedCellCollection<K extends Comparable<K>>
- Returns:
- the collection key
-
iterator
- Specified by:
iterator
in interfaceCollection<K extends Comparable<K>>
- Specified by:
iterator
in interfaceIterable<K extends Comparable<K>>
- Specified by:
iterator
in classAbstractCollection<Cell<?>>
-
size
public int size()- Specified by:
size
in interfaceCollection<K extends Comparable<K>>
- Specified by:
size
in classAbstractCollection<Cell<?>>
-
get
Description copied from interface:CellCollection
Retrieve 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 anOptional
and returned. If this record contains no matching cell then an emptyOptional
is returned.- Specified by:
get
in interfaceCellCollection
- Type Parameters:
T
- the cell JDK type- Parameters:
cellDefinition
- cell to retrieve- Returns:
- An
Optional
with the cell value or an emptyOptional
if the record contains no matching cell
-
get
Description copied from interface:CellCollection
Retrieve a cell by name. If this record contains a cell whose definition matches the supplied name then that cell's value is wrapped in anOptional
and returned. If this record contains no matching cell then an emptyOptional
is returned.- Specified by:
get
in interfaceCellCollection
- Parameters:
name
- cell to retrieve- Returns:
- An
Optional
with the cell value or an emptyOptional
if the record contains no matching cell
-
cell
Description copied from interface:CellCollection
Retrieve a cell by name. If this record contains a cell whose definition matches the supplied name then the cell is wrapped in anOptional
and returned. If this record contains no matching cell then an emptyOptional
is returned.- Specified by:
cell
in interfaceCellCollection
- Parameters:
name
- cell to retrieve- Returns:
- An
Optional
with the cell or an emptyOptional
if the record contains no matching cell
-
contains
- Specified by:
contains
in interfaceCollection<K extends Comparable<K>>
- Overrides:
contains
in classAbstractCollection<Cell<?>>
-
toString
- Overrides:
toString
in classAbstractCollection<Cell<?>>
-
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 classObject
- 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 classObject
- See Also:
-
spliterator
- Specified by:
spliterator
in interfaceCollection<K extends Comparable<K>>
- Specified by:
spliterator
in interfaceIterable<K extends Comparable<K>>
-