org.pcollections

## Class MapPSet<E>

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractSet<E>
    - - org.pcollections.MapPSet<E>

Type Parameters:
  `E` -

All Implemented Interfaces:
  Iterable<E>, Collection<E>, Set<E>, PCollection<E>, PSet<E>

    public final class MapPSet<E>
    extends AbstractSet<E>
    implements PSet<E>

A map-backed persistent set.

If the backing map is thread-safe, then this implementation is thread-safe (assuming Java's AbstractSet is thread-safe), although its iterators may not be.

### Method Summary

Methods
`boolean` `contains(Object e)`
`static <E> MapPSet<E>` `from(PMap<E,?> map)`
`static <E> MapPSet<E>` `from(PMap<E,?> map, Collection<? extends E> list)`
`static <E> MapPSet<E>` `from(PMap<E,?> map, E e)`
`Iterator<E>` `iterator()`
`MapPSet<E>` `minus(Object e)`
`MapPSet<E>` `minusAll(Collection<?> list)`
`MapPSet<E>` `plus(E e)`
`MapPSet<E>` `plusAll(Collection<? extends E> list)`
`int` `size()`

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

`equals, hashCode, removeAll`

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

`add, addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString`

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

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

### Methods inherited from interface org.pcollections.PCollection

`add, addAll, clear, remove, removeAll, retainAll`

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

`add, addAll, clear, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray`

### Method Detail

#### from

    public static <E> MapPSet<E> from(PMap<E,?> map)

Type Parameters:
  `E` -
Parameters:
  `map` -
Returns:
  a PSet with the elements of map.keySet(), backed by map

#### from

    public static <E> MapPSet<E> from(PMap<E,?> map,
                      E e)

Type Parameters:
  `E` -
Parameters:
  `map` -
  `e` -
Returns:
  from(map).plus(e)

#### from

    public static <E> MapPSet<E> from(PMap<E,?> map,
                      Collection<? extends E> list)

Type Parameters:
  `E` -
Parameters:
  `map` -
  `list` -
Returns:
  from(map).plusAll(list)

#### iterator

    public Iterator<E> iterator()

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

#### size

    public int size()

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

#### contains

    public boolean contains(Object e)

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

#### plus

    public MapPSet<E> plus(E e)

Specified by:
  `plus` in interface `PCollection<E>`
Specified by:
  `plus` in interface `PSet<E>`
Parameters:
  `e` - non-null
Returns:
  a collection which contains e and all of the elements of this

#### minus

    public MapPSet<E> minus(Object e)

Specified by:
  `minus` in interface `PCollection<E>`
Specified by:
  `minus` in interface `PSet<E>`
Returns:
  this with a single instance of e removed, if e is in this

#### plusAll

    public MapPSet<E> plusAll(Collection<? extends E> list)

Specified by:
  `plusAll` in interface `PCollection<E>`
Specified by:
  `plusAll` in interface `PSet<E>`
Parameters:
  `list` - contains no null elements
Returns:
  a collection which contains all of the elements of list and this

#### minusAll

    public MapPSet<E> minusAll(Collection<?> list)

Specified by:
  `minusAll` in interface `PCollection<E>`
Specified by:
  `minusAll` in interface `PSet<E>`
Returns:
  this with all elements of list completely removed

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC3
Release Date | : March 24 2015