E
- value typepublic final class TernaryVennModelImpl<E> extends Object implements TernaryVennModel<E>
Constructor and Description |
---|
TernaryVennModelImpl()
Create a new empty ternary venn model.
|
TernaryVennModelImpl(Set<? extends E> first,
Set<? extends E> second,
Set<? extends E> third)
Create a new ternary 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 ternary venn model.
|
Set<E> |
firstOnly()
Return an immutable view of the elements unique to the first
set for this ternary venn model.
|
Set<E> |
firstSecond()
Return an immutable view of the elements unique to the intersection
of the first and second sets for this ternary venn model.
|
Set<E> |
firstThird()
Return an immutable view of the elements unique to the intersection
of the first and third sets for this ternary 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, second, and third
sets for this ternary venn model.
|
ObservableSet<E> |
second()
Return a mutable observable view of the second set for
this ternary venn model.
|
Set<E> |
secondOnly()
Return an immutable view of the elements unique to the second
set for this ternary venn model.
|
Set<E> |
secondThird()
Return an immutable view of the elements unique to the intersection
of the second and third sets for this ternary venn model.
|
ObservableSet<E> |
selection()
Return a mutable observable view of the selection for this
ternary venn model.
|
int |
size()
Return the number of sets in this venn model.
|
ObservableSet<E> |
third()
Return a mutable observable view of the third set for
this ternary venn model.
|
Set<E> |
thirdOnly()
Return an immutable view of the elements unique to the third
set for this ternary venn model.
|
Set<E> |
union()
Return an immutable view of the union of the first, second, and third
sets for this ternary venn model.
|
public TernaryVennModelImpl()
public int size()
public ObservableSet<E> first()
first
in interface TernaryVennModel<E>
public ObservableSet<E> second()
second
in interface TernaryVennModel<E>
public ObservableSet<E> third()
third
in interface TernaryVennModel<E>
public Set<E> firstOnly()
TernaryVennModel.first()
,
TernaryVennModel.second()
, and TernaryVennModel.third()
).firstOnly
in interface TernaryVennModel<E>
public Set<E> secondOnly()
TernaryVennModel.first()
,
TernaryVennModel.second()
, and TernaryVennModel.third()
).secondOnly
in interface TernaryVennModel<E>
public Set<E> thirdOnly()
TernaryVennModel.first()
,
TernaryVennModel.second()
, and TernaryVennModel.third()
).thirdOnly
in interface TernaryVennModel<E>
public Set<E> firstSecond()
TernaryVennModel.first()
,
TernaryVennModel.second()
, and TernaryVennModel.third()
).firstSecond
in interface TernaryVennModel<E>
public Set<E> firstThird()
TernaryVennModel.first()
,
TernaryVennModel.second()
, and TernaryVennModel.third()
).firstThird
in interface TernaryVennModel<E>
public Set<E> secondThird()
TernaryVennModel.first()
,
TernaryVennModel.second()
, and TernaryVennModel.third()
).secondThird
in interface TernaryVennModel<E>
public Set<E> intersection()
TernaryVennModel.first()
,
TernaryVennModel.second()
, and TernaryVennModel.third()
).intersection
in interface TernaryVennModel<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()
TernaryVennModel.first()
,
TernaryVennModel.second()
, and TernaryVennModel.third()
).public ObservableSet<E> selection()
TernaryVennModel.first()
,
TernaryVennModel.second()
, and TernaryVennModel.third()
), and may not contain any elements
not present in the union (TernaryVennModel.union()
).selection
in interface TernaryVennModel<E>
Copyright (c) 2009-2013 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).