E
- value typepublic final class BinaryVennModelImpl<E> extends Object implements BinaryVennModel<E>
Constructor and Description |
---|
BinaryVennModelImpl()
Create a new empty binary venn model.
|
BinaryVennModelImpl(Set<? extends E> first,
Set<? extends E> second)
Create a new binary venn model with the specified sets.
|
Modifier and Type | Method and Description |
---|---|
Set<E> |
exclusiveTo(int index,
int... additional)
Return an immutable set view of the elements exclusive to the sets in this venn model
identified by the specified indices.
|
ObservableSet<E> |
first()
Return a mutable observable view of the first set for
this binary venn model.
|
Set<E> |
firstOnly()
Return an immutable view of the elements unique to the first
set for this binary venn model.
|
Set<E> |
get(int index)
Return the set at the specified index in this venn model.
|
Set<E> |
intersection()
Return an immutable view of the intersection of the first and second
sets for this binary venn model.
|
ObservableSet<E> |
second()
Return a mutable observable view of the second set for
this binary venn model.
|
Set<E> |
secondOnly()
Return an immutable view of the elements unique to the second
set for this binary venn model.
|
ObservableSet<E> |
selection()
Return a mutable observable view of the selection for this
binary venn model.
|
int |
size()
Return the number of sets in this venn model.
|
Set<E> |
union()
Return an immutable view of the union of the first and second
sets for this binary venn model.
|
public BinaryVennModelImpl()
public int size()
public ObservableSet<E> first()
first
in interface BinaryVennModel<E>
public ObservableSet<E> second()
second
in interface BinaryVennModel<E>
public Set<E> firstOnly()
BinaryVennModel.first()
,
BinaryVennModel.second()
).firstOnly
in interface BinaryVennModel<E>
public Set<E> secondOnly()
BinaryVennModel.first()
,
BinaryVennModel.second()
).secondOnly
in interface BinaryVennModel<E>
public Set<E> intersection()
BinaryVennModel.first()
,
BinaryVennModel.second()
).intersection
in interface BinaryVennModel<E>
intersection
in interface VennModel<E>
public Set<E> exclusiveTo(int index, int... additional)
n = 3
VennModel<String> vennModel = ...; Set<String> first = vennModel.get(0); Set<String> second = vennModel.get(1); Set<String> third = vennModel.get(2); Set<String> firstOnly = vennModel.exclusiveTo(0); Set<String> firstSecond = vennModel.exclusiveTo(0, 1); Set<String> intersection = vennModel.exclusiveTo(0, 1, 2);
This is equivalent to the difference of the intersection of the sets in this venn model identified by the specified indices and the union of the remainder sets in this venn model.
exclusiveTo
in interface VennModel<E>
index
- first indexadditional
- variable number of additional indices, if anypublic Set<E> union()
BinaryVennModel.first()
,
BinaryVennModel.second()
).public ObservableSet<E> selection()
BinaryVennModel.first()
,
BinaryVennModel.second()
), and may not contain any elements not present
in the union (BinaryVennModel.union()
).selection
in interface BinaryVennModel<E>
Copyright (c) 2009-2013 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).