public class Card extends Object implements Serializable
Constructor and Description |
---|
Card()
Construct an unbounded cardinality.
|
Card(int low)
Construct a cardinality bounded from below, unbounded above.
|
Card(int low,
int high)
Construct a cardinality bounded from below and above.
|
Modifier and Type | Method and Description |
---|---|
Card |
add(Card addend)
Add two cardinalities together.
|
boolean |
equals(Object obj) |
int |
getHigh()
Returns the high cardinality or Integer.MAX_VALUE if unbounded form
above.
|
int |
getLow()
Returns the low cardinality or 0 if unbounded from below.
|
int |
hashCode() |
boolean |
hasHigh()
Detects if this cardinality is bounded above.
|
boolean |
hasLow()
Detects if this cardinality is bounded below.
|
boolean |
isBounded()
Detects if this cardinality is either bounded below and/or above.
|
boolean |
isExact()
Detects if this cardinality is so restrictive that only one possible
value is allowed.
|
Card |
mult(Card factor)
Multiply two cardinalities together.
|
String |
toString() |
public Card()
public Card(int low)
low
- the low cardinalitypublic Card(int low, int high)
low
- the low cardinalityhigh
- the high cardinalitypublic boolean isExact()
true
if and only if low and high cardinality is the same,
false
otherwisepublic boolean isBounded()
true
if and only if this cardinality is not unbounded,
false
otherwisepublic boolean hasLow()
true
if and only if this cardinality is bounded below,
false
otherwisepublic int getLow()
public boolean hasHigh()
true
if and only if this cardinality is bounded above,
false
otherwisepublic int getHigh()
public Card add(Card addend)
addend
- the other cardinalitypublic Card mult(Card factor)
factor
- the other cardinalityCopyright © 2013. All Rights Reserved.