Package com.terracottatech.store
Class AbstractRecord<K extends Comparable<K>>
- Type Parameters:
K
- record key type.
- All Implemented Interfaces:
CellCollection
,KeyedCellCollection<K>
,Record<K>
,Iterable<Cell<?>>
,Collection<Cell<?>>
public abstract class AbstractRecord<K extends Comparable<K>>
extends AbstractCollection<Cell<?>>
implements Record<K>
A useful partial implementation of
Record
.-
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 TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends Cell<?>> c) void
clear()
boolean
Indicates whether this record is equal to another object.int
hashCode()
Returns a hash code value for this collection.boolean
boolean
removeAll
(Collection<?> c) boolean
boolean
retainAll
(Collection<?> c) toString()
Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, iterator, size, toArray, toArray
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
contains, containsAll, isEmpty, iterator, parallelStream, size, spliterator, stream, toArray, toArray, toArray
Methods inherited from interface com.terracottatech.store.KeyedCellCollection
asStoreMap, getKey, subset, subset
Methods inherited from interface com.terracottatech.store.Record
getEqualsPredicate
-
Constructor Details
-
AbstractRecord
public AbstractRecord()
-
-
Method Details
-
toString
- Overrides:
toString
in classAbstractCollection<Cell<?>>
-
equals
Description copied from interface:Record
Indicates whether this record is equal to another object.A record is equal to:
- the ABA-safe same record from the same dataset
- a record from a different dataset with the same contents
- a keyed-cell collection that is not a record and has the same contents
- Specified by:
equals
in interfaceCollection<K extends Comparable<K>>
- Specified by:
equals
in interfaceKeyedCellCollection<K extends Comparable<K>>
- Specified by:
equals
in interfaceRecord<K extends Comparable<K>>
- Overrides:
equals
in classObject
- Parameters:
obj
- object to be compared for equality with this record- Returns:
true
if the specified object is equal to this record- See Also:
-
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:
-
add
- Specified by:
add
in interfaceCollection<K extends Comparable<K>>
- Overrides:
add
in classAbstractCollection<Cell<?>>
-
remove
- Specified by:
remove
in interfaceCollection<K extends Comparable<K>>
- Overrides:
remove
in classAbstractCollection<Cell<?>>
-
addAll
- Specified by:
addAll
in interfaceCollection<K extends Comparable<K>>
- Overrides:
addAll
in classAbstractCollection<Cell<?>>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<K extends Comparable<K>>
- Overrides:
removeAll
in classAbstractCollection<Cell<?>>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<K extends Comparable<K>>
- Overrides:
retainAll
in classAbstractCollection<Cell<?>>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<K extends Comparable<K>>
- Overrides:
clear
in classAbstractCollection<Cell<?>>
-
removeIf
- Specified by:
removeIf
in interfaceCollection<K extends Comparable<K>>
-