Skip navigation links
com.tangosol.util
Class InflatableCollection
java.lang.Object
java.util.AbstractCollection
com.tangosol.util.InflatableCollection
- All Implemented Interfaces:
- java.lang.Iterable, java.util.Collection
- Direct Known Subclasses:
- InflatableList, InflatableSet
-
public abstract class InflatableCollection
- extends java.util.AbstractCollection
A Collection implementation which optimizes memory consumption for collections that often contain just a single value. This implementation also reduces contention for read operations (e.g. contains, iterator, etc.)
- Since:
- Coherence 3.6
- Author:
- ch 2009.11.22
Field Summary |
protected java.util.concurrent.atomic.AtomicReference |
m_refValue
Holds NO_VALUE, a single value, or an InflatedCollection of values. |
protected static java.lang.Object |
NO_VALUE
A marker value indicating that the single value has not been initialized. |
Methods inherited from class java.util.AbstractCollection |
addAll, containsAll, isEmpty, toString |
NO_VALUE
protected static final java.lang.Object NO_VALUE
- A marker value indicating that the single value has not been initialized.
m_refValue
protected final java.util.concurrent.atomic.AtomicReference m_refValue
- Holds NO_VALUE, a single value, or an InflatedCollection of values.
InflatableCollection
public InflatableCollection()
equals
public boolean equals(java.lang.Object o)
hashCode
public int hashCode()
add
public boolean add(java.lang.Object o)
-
- Specified by:
add
in interface java.util.Collection
- Overrides:
add
in class java.util.AbstractCollection
remove
public boolean remove(java.lang.Object o)
-
- Specified by:
remove
in interface java.util.Collection
- Overrides:
remove
in class java.util.AbstractCollection
removeAll
public boolean removeAll(java.util.Collection c)
-
- Specified by:
removeAll
in interface java.util.Collection
- Overrides:
removeAll
in class java.util.AbstractCollection
retainAll
public boolean retainAll(java.util.Collection c)
-
- Specified by:
retainAll
in interface java.util.Collection
- Overrides:
retainAll
in class java.util.AbstractCollection
clear
public void clear()
-
- Specified by:
clear
in interface java.util.Collection
- Overrides:
clear
in class java.util.AbstractCollection
contains
public boolean contains(java.lang.Object o)
-
- Specified by:
contains
in interface java.util.Collection
- Overrides:
contains
in class java.util.AbstractCollection
iterator
public java.util.Iterator iterator()
-
- Specified by:
iterator
in interface java.lang.Iterable
- Specified by:
iterator
in interface java.util.Collection
- Specified by:
iterator
in class java.util.AbstractCollection
size
public int size()
-
- Specified by:
size
in interface java.util.Collection
- Specified by:
size
in class java.util.AbstractCollection
toArray
public java.lang.Object[] toArray()
-
- Specified by:
toArray
in interface java.util.Collection
- Overrides:
toArray
in class java.util.AbstractCollection
toArray
public java.lang.Object[] toArray(java.lang.Object[] ao)
-
- Specified by:
toArray
in interface java.util.Collection
- Overrides:
toArray
in class java.util.AbstractCollection
instantiateCollection
protected abstract InflatableCollection.InflatedCollection instantiateCollection()
- Factory method used to create a new Collection. The returned Collection must provide a "safe" iterator.
-
- Returns:
- a "real" implementation to use if this collection is expanded
Skip navigation links
Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.