Top Description Fields Constructors Methods
net.sf.ehcache.util

public abstract Class LargeCollection<E>

extends AbstractCollection<E>
Class Inheritance
Known Direct Subclasses
net.sf.ehcache.util.LargeSet
Imports
java.util.AbstractCollection, .ArrayList, .Collection, .HashSet, .Iterator, .List

Collection for large set. The general purpose is not to iterator through all the keys for add and remove operations.
Author
Nabib El-Rahman

Field Summary

Modifier and TypeField and Description
private final Collection<E>
addSet

Set that keeps tabs on add add() to collection.

private final Collection<Object>
removeSet

Set that keeps tabs of all remove() to collection.

Constructor Summary

AccessConstructor and Description
public
LargeCollection()

default constructor.

Method Summary

Modifier and TypeMethod and Description
public final boolean
add(final E
element whose presence in this collection is to be ensured
obj
)

Overrides java.util.AbstractCollection.add.

Implements java.util.Collection.add.

Ensures that this collection contains the specified element (optional operation).
private Iterator<E>

Returns:

Iterator < E >
additionalIterator
()

Iterator for addSet.

public final boolean
contains(final Object
element whose presence in this collection is to be tested
obj
)

Overrides java.util.AbstractCollection.contains.

Implements java.util.Collection.contains.

Returns true if this collection contains the specified element.
public final Iterator<E>
iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Collection.iterator.

Returns an iterator over the elements contained in this collection.
public final boolean
remove(final Object
element to be removed from this collection, if present
obj
)

Overrides java.util.AbstractCollection.remove.

Implements java.util.Collection.remove.

Removes a single instance of the specified element from this collection, if it is present (optional operation).
public final boolean
removeAll(final Collection<?>
collection containing elements to be removed from this collection
removeCandidates
)

Overrides java.util.AbstractCollection.removeAll.

Implements java.util.Collection.removeAll.

Removes all of this collection's elements that are also contained in the specified collection (optional operation).
public final int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Collection.size.

Returns the number of elements in this collection.
public abstract Iterator<E>

Returns:

Iterator<E>
sourceIterator
()

Iterator of initial set of entries.

public abstract int

Returns:

integer
sourceSize
()

Initial set of entries size.

Inherited from java.util.AbstractCollection:
addAllclearcontainsAllisEmptyretainAlltoArraytoArraytoString

Field Detail

addSetback to summary
private final Collection<E> addSet

Set that keeps tabs on add add() to collection.

removeSetback to summary
private final Collection<Object> removeSet

Set that keeps tabs of all remove() to collection.

Constructor Detail

LargeCollectionback to summary
public LargeCollection()

default constructor.

Method Detail

addback to summary
public final boolean add(final E obj)

Overrides java.util.AbstractCollection.add.

Implements java.util.Collection.add.

Doc from java.util.AbstractCollection.add.

Ensures that this collection contains the specified element (optional operation). Returns true if this collection changed as a result of the call. (Returns false if this collection does not permit duplicates and already contains the specified element.)

Collections that support this operation may place limitations on what elements may be added to this collection. In particular, some collections will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. Collection classes should clearly specify in their documentation any restrictions on what elements may be added.

If a collection refuses to add a particular element for any reason other than that it already contains the element, it must throw an exception (rather than returning false). This preserves the invariant that a collection always contains the specified element after this call returns.

Parameters
obj:E

Doc from java.util.Collection.add.

element whose presence in this collection is to be ensured

Returns:boolean

Doc from java.util.Collection.add.

true if this collection changed as a result of the call

Annotations
@Override
additionalIteratorback to summary
private Iterator<E> additionalIterator()

Iterator for addSet.

Returns:Iterator<E>

Iterator < E >

containsback to summary
public final boolean contains(final Object obj)

Overrides java.util.AbstractCollection.contains.

Implements java.util.Collection.contains.

Doc from java.util.AbstractCollection.contains.

Returns true if this collection contains the specified element. More formally, returns true if and only if this collection contains at least one element e such that Objects.equals(o, e).

Parameters
obj:Object

Doc from java.util.Collection.contains.

element whose presence in this collection is to be tested

Returns:boolean

Doc from java.util.Collection.contains.

true if this collection contains the specified element

Annotations
@Override
iteratorback to summary
public final Iterator<E> iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Collection.iterator.

Doc from java.util.AbstractCollection.iterator.

Returns an iterator over the elements contained in this collection.

Returns:Iterator<E>

an iterator over the elements contained in this collection

removeback to summary
public final boolean remove(final Object obj)

Overrides java.util.AbstractCollection.remove.

Implements java.util.Collection.remove.

Doc from java.util.AbstractCollection.remove.

Removes a single instance of the specified element from this collection, if it is present (optional operation). More formally, removes an element e such that Objects.equals(o, e), if this collection contains one or more such elements. Returns true if this collection contained the specified element (or equivalently, if this collection changed as a result of the call).

Parameters
obj:Object

Doc from java.util.Collection.remove.

element to be removed from this collection, if present

Returns:boolean

Doc from java.util.Collection.remove.

true if an element was removed as a result of this call

Annotations
@Override
removeAllback to summary
public final boolean removeAll(final Collection<?> removeCandidates)

Overrides java.util.AbstractCollection.removeAll.

Implements java.util.Collection.removeAll.

Doc from java.util.AbstractCollection.removeAll.

Removes all of this collection's elements that are also contained in the specified collection (optional operation). After this call returns, this collection will contain no elements in common with the specified collection.

Parameters
removeCandidates:Collection<?>

Doc from java.util.Collection.removeAll.

collection containing elements to be removed from this collection

Returns:boolean

Doc from java.util.Collection.removeAll.

true if this collection changed as a result of the call

sizeback to summary
public final int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Collection.size.

Doc from java.util.Collection.size.

Returns the number of elements in this collection. If this collection contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this collection

sourceIteratorback to summary
public abstract Iterator<E> sourceIterator()

Iterator of initial set of entries.

Returns:Iterator<E>

Iterator<E>

sourceSizeback to summary
public abstract int sourceSize()

Initial set of entries size.

Returns:int

integer