public class ValueSet<T> extends Object
| Constructor and Description |
|---|
ValueSet(boolean isPositive,
Set<T> values) |
ValueSet(Set<T> values) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Object item) |
static <T> ValueSet<T> |
create(boolean isPositive,
T... values) |
boolean |
equals(Object obj) |
int |
hashCode() |
ValueSet<T> |
intersect(ValueSet<T> that)
case: positive - positive
Simply take the intersection
case: positive - negative
{1, 2, 3} intersect {not {2}}: -> {1, 3} (positive.removeAll(negative))
case: negative - positive
Same as above
case: negative - negative
Simply take the union
|
boolean |
isEmpty() |
ValueSet<T> |
negate() |
String |
toString() |
ValueSet<T> |
union(ValueSet<T> that)
case: positive - positive
Simply take the union
case: positive - negative
{1, 2, 3} intersect {not {1, 4}}: -> {4} (negative.removeAll(positive))
case: negative - positive
Same as above
case: negative - negative
Simply take the intersection
|
public static <T> ValueSet<T> create(boolean isPositive, T... values)
public ValueSet<T> intersect(ValueSet<T> that)
other - public ValueSet<T> union(ValueSet<T> that)
that - public boolean isEmpty()
public boolean contains(Object item)
Copyright © 2015. All rights reserved.