org.apache.ignite.internal.processors.datastructures

## Class GridCacheSetImpl<T>

- java.lang.Object
- - java.util.AbstractCollection<T>
  - - org.apache.ignite.internal.processors.datastructures.GridCacheSetImpl<T>

All Implemented Interfaces:
  Closeable, AutoCloseable, Iterable<T>, Collection<T>, Set<T>, IgniteSet<T>

    public class GridCacheSetImpl<T>
    extends AbstractCollection<T>
    implements IgniteSet<T>

Cache set implementation.

### Constructor Summary

Constructors
Constructor and Description
`GridCacheSetImpl(GridCacheContext ctx, String name, GridCacheSetHeader hdr)`

### Method Summary

Methods
`boolean` `add(T o)`
`boolean` `addAll(Collection<? extends T> c)`
`void` `clear()`
`void` `close()` Removes this set.
`boolean` `collocated()` Returns `true` if this set can be kept on the one node only.
`boolean` `contains(Object o)`
`boolean` `containsAll(Collection<?> c)`
`boolean` `isEmpty()`
`Iterator<T>` `iterator()`
`String` `name()` Gets set name.
`boolean` `remove(Object o)`
`boolean` `removeAll(Collection<?> c)`
`boolean` `removed()` Gets status of set.
`boolean` `retainAll(Collection<?> c)`
`int` `size()`
`String` `toString()`

### Methods inherited from class java.util.AbstractCollection

`toArray, toArray`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.apache.ignite.IgniteSet

`toArray, toArray`

### Methods inherited from interface java.util.Set

`equals, hashCode`

### Constructor Detail

#### GridCacheSetImpl

    public GridCacheSetImpl(GridCacheContext ctx,
                    String name,
                    GridCacheSetHeader hdr)

Parameters:
  `ctx` - Cache context.
  `name` - Set name.
  `hdr` - Set header.

### Method Detail

#### collocated

    public boolean collocated()

Returns `true` if this set can be kept on the one node only. Returns `false` if this set can be kept on the many nodes.

Specified by:
  `collocated` in interface `IgniteSet<T>`
Returns:
  `True` if this set is in `collocated` mode `false` otherwise.

#### name

    public String name()

Gets set name.

Specified by:
  `name` in interface `IgniteSet<T>`
Returns:
  Set name.

#### removed

    public boolean removed()

Gets status of set.

Specified by:
  `removed` in interface `IgniteSet<T>`
Returns:
  `True` if set was removed from cache `false` otherwise.

#### size

    public int size()

Specified by:
  `size` in interface `Collection<T>`
Specified by:
  `size` in interface `Set<T>`
Specified by:
  `size` in interface `IgniteSet<T>`
Specified by:
  `size` in class `AbstractCollection<T>`

#### isEmpty

    public boolean isEmpty()

Specified by:
  `isEmpty` in interface `Collection<T>`
Specified by:
  `isEmpty` in interface `Set<T>`
Specified by:
  `isEmpty` in interface `IgniteSet<T>`
Overrides:
  `isEmpty` in class `AbstractCollection<T>`

#### contains

    public boolean contains(Object o)

Specified by:
  `contains` in interface `Collection<T>`
Specified by:
  `contains` in interface `Set<T>`
Specified by:
  `contains` in interface `IgniteSet<T>`
Overrides:
  `contains` in class `AbstractCollection<T>`

#### add

    public boolean add(T o)

Specified by:
  `add` in interface `Collection<T>`
Specified by:
  `add` in interface `Set<T>`
Specified by:
  `add` in interface `IgniteSet<T>`
Overrides:
  `add` in class `AbstractCollection<T>`

#### remove

    public boolean remove(Object o)

Specified by:
  `remove` in interface `Collection<T>`
Specified by:
  `remove` in interface `Set<T>`
Specified by:
  `remove` in interface `IgniteSet<T>`
Overrides:
  `remove` in class `AbstractCollection<T>`

#### containsAll

    public boolean containsAll(Collection<?> c)

Specified by:
  `containsAll` in interface `Collection<T>`
Specified by:
  `containsAll` in interface `Set<T>`
Specified by:
  `containsAll` in interface `IgniteSet<T>`
Overrides:
  `containsAll` in class `AbstractCollection<T>`

#### addAll

    public boolean addAll(Collection<? extends T> c)

Specified by:
  `addAll` in interface `Collection<T>`
Specified by:
  `addAll` in interface `Set<T>`
Specified by:
  `addAll` in interface `IgniteSet<T>`
Overrides:
  `addAll` in class `AbstractCollection<T>`

#### removeAll

    public boolean removeAll(Collection<?> c)

Specified by:
  `removeAll` in interface `Collection<T>`
Specified by:
  `removeAll` in interface `Set<T>`
Specified by:
  `removeAll` in interface `IgniteSet<T>`
Overrides:
  `removeAll` in class `AbstractCollection<T>`

#### retainAll

    public boolean retainAll(Collection<?> c)

Specified by:
  `retainAll` in interface `Collection<T>`
Specified by:
  `retainAll` in interface `Set<T>`
Specified by:
  `retainAll` in interface `IgniteSet<T>`
Overrides:
  `retainAll` in class `AbstractCollection<T>`

#### clear

    public void clear()

Specified by:
  `clear` in interface `Collection<T>`
Specified by:
  `clear` in interface `Set<T>`
Specified by:
  `clear` in interface `IgniteSet<T>`
Overrides:
  `clear` in class `AbstractCollection<T>`

#### iterator

    public Iterator<T> iterator()

Specified by:
  `iterator` in interface `Iterable<T>`
Specified by:
  `iterator` in interface `Collection<T>`
Specified by:
  `iterator` in interface `Set<T>`
Specified by:
  `iterator` in interface `IgniteSet<T>`
Specified by:
  `iterator` in class `AbstractCollection<T>`

#### close

    public void close()

Removes this set.

Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `IgniteSet<T>`

#### toString

    public String toString()

Overrides:
  `toString` in class `AbstractCollection<T>`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.1.0-incubating
Release Date | : May 20 2015