|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbr.usp.ime.klava.segmentit.util.Cost
public class Cost
Represents a lexicographic cost with two components.
Constructor Summary | |
---|---|
Cost()
Creates a lexicographic cost (Infinity, Infinity) . |
|
Cost(int max,
int dist)
Creates a lexicographic cost (max, dist) . |
Method Summary | |
---|---|
int |
getDist()
Returns the value of dist (second component of the cost). |
int |
getMax()
Returns the value of max (first component of the cost). |
boolean |
greaterThan(Cost cost)
Returns if this cost is greater than the given cost . |
boolean |
isInfinity()
Returns if this cost is equal to (Infinity, Infinity) . |
void |
setCost(int max,
int dist)
Sets this cost to (max, dist) . |
void |
setInfinity()
Sets this cost to (Infinity, Infinity) . |
java.lang.String |
toString()
Returns a String representation of this cost. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Cost()
(Infinity, Infinity)
.
public Cost(int max, int dist)
(max, dist)
.
max
- the first component of the costdist
- the second component of the costMethod Detail |
---|
public int getMax()
max
(first component of the cost).
max
public int getDist()
dist
(second component of the cost).
dist
public void setInfinity()
(Infinity, Infinity)
.
public void setCost(int max, int dist)
(max, dist)
.
max
- the first component of the costdist
- the second component of the costpublic boolean isInfinity()
(Infinity, Infinity)
.
true
if this cost is equal to
(Infinity, Infinity)
public boolean greaterThan(Cost cost)
cost
.
cost
- the cost to be compared
true
if this cost is greater than cost
public java.lang.String toString()
String
representation of this cost.
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |