Package org.eclipse.m2m.atl.emftvm.util

# Class LazySet.IncludingSet<E>

java.lang.Object
org.eclipse.m2m.atl.emftvm.util.LazyCollection<E>
org.eclipse.m2m.atl.emftvm.util.LazySet<E>
org.eclipse.m2m.atl.emftvm.util.LazySet.NonCachingSet<E>
org.eclipse.m2m.atl.emftvm.util.LazySet.IncludingSet<E>

Type Parameters:
  `E` - the collection element type

All Implemented Interfaces:
  `Iterable<E>`, `Collection<E>`, `Set<E>`

Enclosing class:
  LazySet<E>

public static class LazySet.IncludingSet<E> extends LazySet.NonCachingSet<E>
`LazySet` that includes an element into the underlying `LazySet`, except if the element already occurs in the underlying `LazySet`.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`class`
`LazySet.IncludingSet.IncludingSetIterator`
`Iterator` that appends an object to the underlying collection, except when it already occurs in the underlying collection.

## Nested classes/interfaces inherited from class org.eclipse.m2m.atl.emftvm.util.LazySet

`LazySet.ExcludingSet<E>, LazySet.IncludingSet<E>, LazySet.IntegerRangeSet, LazySet.LongRangeSet, LazySet.NonCachingSet<E>`

## Nested classes/interfaces inherited from class org.eclipse.m2m.atl.emftvm.util.LazyCollection

`LazyCollection.AppendIterator, LazyCollection.CachingIterator, LazyCollection.CachingSetIterator, LazyCollection.CollectIterator<T>, LazyCollection.ExcludingIterator, LazyCollection.FilterIterator, LazyCollection.FlattenIterator, LazyCollection.FlattenSetIterator, LazyCollection.IntegerRangeListIterator, LazyCollection.IntersectionIterator, LazyCollection.IteratorToListIterator, LazyCollection.LongRangeListIterator, LazyCollection.ReadOnlyIterator<E>, LazyCollection.ReadOnlyListIterator<E>, LazyCollection.RejectIterator, LazyCollection.ReverseIterator, LazyCollection.ReverseListIterator, LazyCollection.SelectIterator, LazyCollection.SubListIterator, LazyCollection.SubListListIterator, LazyCollection.SubtractionIterator, LazyCollection.UnionIterator, LazyCollection.UnionSetIterator, LazyCollection.WrappedIterator, LazyCollection.WrappedListIterator`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected boolean`
`containsObject`
`protected boolean`
`containsSet`
`protected final E`
`object`

### Fields inherited from class org.eclipse.m2m.atl.emftvm.util.LazyCollection

`cache, dataSource, occurrences`

## Constructor Summary

Constructors
Constructor
Description
`IncludingSet(E object, LazySet<E> dataSource)`
Creates a new `LazySet.IncludingSet`.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`contains(Object o)`
`int`
`count(Object o)`
Returns the number of occurrences of `object` in self.
`post: result <= 1`
`boolean`
`isEmpty()`
`Iterator<E>`
`iterator()`
`int`
`size()`

### Methods inherited from class org.eclipse.m2m.atl.emftvm.util.LazySet.NonCachingSet

`createCache`

### Methods inherited from class org.eclipse.m2m.atl.emftvm.util.LazySet

`asSet, asString, collect, equals, excluding, excludingAll, flatten, hashCode, including, including, includingAll, includingAll, includingRange, intersection, intersection, reject, select, sortedBy, subtract, symmetricDifference, union, union`

### Methods inherited from class org.eclipse.m2m.atl.emftvm.util.LazyCollection

`add, addAll, any, appendElements, asBag, asOrderedSet, asSequence, clear, containsAll, containsAny, excludes, excludesAll, exists, exists2, forAll, forAll2, includes, includesAll, isUnique, iterate, mappedBy, mappedBySingle, max, min, notEmpty, one, product, remove, removeAll, retainAll, sum, toArray, toArray, toString`

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

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

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

`parallelStream, removeIf, stream, toArray`

### Methods inherited from interface java.lang.Iterable

`forEach`

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

`add, addAll, clear, containsAll, remove, removeAll, retainAll, spliterator, toArray, toArray`

## Field Details

### object

protected final E object

### containsObject

protected boolean containsObject

### containsSet

protected boolean containsSet

## Constructor Details

### IncludingSet

public IncludingSet(E object, LazySet<E> dataSource)
Creates a new `LazySet.IncludingSet`.

Parameters:
  `object` - the element to include
  `dataSource` - the underlying collection

## Method Details

### contains

public boolean contains(Object o)

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

### count

public int count(Object o)
Returns the number of occurrences of `object` in self.
`post: result <= 1`

Overrides:
  `count` in class `LazySet<E>`
Parameters:
  `o` - the object to count
Returns:
  The number of occurrences of `object` in self.

### isEmpty

public boolean isEmpty()

Specified by:
  `isEmpty` in interface `Collection<E>`
Specified by:
  `isEmpty` in interface `Set<E>`
Overrides:
  `isEmpty` in class `LazyCollection<E>`

### iterator

public Iterator<E> iterator()

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

### size

public int size()

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