org.apache.ignite.internal.processors.datastructures

## Class GridCacheSetProxy<T>

- java.lang.Object
- - org.apache.ignite.internal.processors.datastructures.GridCacheSetProxy<T>

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

    public class GridCacheSetProxy<T>
    extends Object
    implements IgniteSet<T>, Externalizable

Cache set proxy.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`GridCacheSetProxy()` Required by `Externalizable`.
`GridCacheSetProxy(GridCacheContext cctx, GridCacheSetImpl<T> delegate)`

### Method Summary

Methods
`boolean` `add(T t)`
`boolean` `addAll(Collection<? extends T> c)`
`<R> R` `affinityCall(IgniteCallable<R> job)` Executes given job on collocated set on the node where the set is located (a.k.a. affinity co-location).
`void` `affinityRun(IgniteRunnable job)` Executes given job on collocated set on the node where the set is located (a.k.a. affinity co-location).
`void` `blockOnRemove()` Remove callback.
`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)`
`GridCacheSetImpl` `delegate()`
`boolean` `isEmpty()`
`Iterator<T>` `iterator()`
`String` `name()` Gets set name.
`void` `needCheckNotRemoved()`
`void` `readExternal(ObjectInput in)`
`protected Object` `readResolve()` Reconstructs object on unmarshalling.
`boolean` `remove(Object o)`
`boolean` `removeAll(Collection<?> c)`
`boolean` `removed()` Gets status of set.
`boolean` `retainAll(Collection<?> c)`
`int` `size()`
`Object[]` `toArray()`
`<T1> T1[]` `toArray(T1[] a)`
`String` `toString()`
`void` `writeExternal(ObjectOutput out)`

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

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

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

`equals, hashCode`

### Constructor Detail

#### GridCacheSetProxy

    public GridCacheSetProxy()

Required by `Externalizable`.

#### GridCacheSetProxy

    public GridCacheSetProxy(GridCacheContext cctx,
                     GridCacheSetImpl<T> delegate)

Parameters:
  `cctx` - Cache context.
  `delegate` - Delegate set.

### Method Detail

#### delegate

    public GridCacheSetImpl delegate()

Returns:
  Set delegate.

#### blockOnRemove

    public void blockOnRemove()

Remove callback.

#### 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>`

#### 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>`

#### 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>`

#### toArray

    @NotNull
    public Object[] toArray()

Specified by:
  `toArray` in interface `Collection<T>`
Specified by:
  `toArray` in interface `Set<T>`
Specified by:
  `toArray` in interface `IgniteSet<T>`

#### toArray

    @NotNull
    public <T1> T1[] toArray(T1[] a)

Specified by:
  `toArray` in interface `Collection<T>`
Specified by:
  `toArray` in interface `Set<T>`
Specified by:
  `toArray` in interface `IgniteSet<T>`

#### add

    public boolean add(T t)

Specified by:
  `add` in interface `Collection<T>`
Specified by:
  `add` in interface `Set<T>`
Specified by:
  `add` in interface `IgniteSet<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>`

#### 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>`

#### 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>`

#### 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>`

#### 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>`

#### 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>`

#### 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>`

#### 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>`

#### name

    public String name()

Gets set name.

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

#### 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.

#### 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.

#### affinityRun

    public void affinityRun(IgniteRunnable job)

Executes given job on collocated set on the node where the set is located (a.k.a. affinity co-location).

This is not supported for non-collocated sets.

Specified by:
  `affinityRun` in interface `IgniteSet<T>`
Parameters:
  `job` - Job which will be co-located with the set.

#### affinityCall

    public <R> R affinityCall(IgniteCallable<R> job)

Executes given job on collocated set on the node where the set is located (a.k.a. affinity co-location).

This is not supported for non-collocated sets.

Specified by:
  `affinityCall` in interface `IgniteSet<T>`
Parameters:
  `job` - Job which will be co-located with the set.

#### needCheckNotRemoved

    public void needCheckNotRemoved()

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

#### readResolve

    protected Object readResolve()
                          throws ObjectStreamException

Reconstructs object on unmarshalling.

Returns:
  Reconstructed object.
Throws:
  `ObjectStreamException` - Thrown in case of unmarshalling error.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.9.0
Release Date | : March 2 2017