public final class CostConstraint extends Object implements Constraint
| Modifier and Type | Class and Description |
|---|---|
static class |
CostConstraint.Type
Represents about cost types.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
COST |
static String |
TE_COST |
| Constructor and Description |
|---|
CostConstraint(CostConstraint.Type type)
Creates a new cost constraint.
|
| Modifier and Type | Method and Description |
|---|---|
double |
cost(Link link,
ResourceContext context)
Evaluates the specified link and provides the cost for its traversal.
|
boolean |
equals(Object obj) |
int |
hashCode() |
static CostConstraint |
of(CostConstraint.Type type)
Creates new CostConstraint with specified cost type.
|
String |
toString() |
CostConstraint.Type |
type()
Returns the type of a cost specified in a constraint.
|
boolean |
validate(Path path,
ResourceContext context)
Validates that the specified path satisfies the constraint.
|
public static final String TE_COST
public static final String COST
public CostConstraint(CostConstraint.Type type)
type - of a linkpublic static CostConstraint of(CostConstraint.Type type)
type - of costpublic CostConstraint.Type type()
public double cost(Link link, ResourceContext context)
Constraintcost in interface Constraintlink - link to be evaluatedcontext - resource context for validating availability of resourcespublic boolean validate(Path path, ResourceContext context)
Constraintvalidate in interface Constraintpath - path to be validatedcontext - resource context for validating availability of resources