@Beta public class AnnotationConstraint extends BooleanConstraint
| Constructor and Description |
|---|
AnnotationConstraint(java.lang.String key,
double threshold)
Creates a new constraint to keep the value for the specified key
of link annotation under the threshold.
|
| 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(java.lang.Object obj) |
int |
hashCode() |
boolean |
isValid(Link link,
ResourceContext context)
Returns true if the specified link satisfies the constraint.
|
java.lang.String |
key()
Returns the key of link annotation this constraint designates.
|
double |
threshold()
Returns the threshold this constraint ensures as link annotated value.
|
java.lang.String |
toString() |
validatepublic AnnotationConstraint(java.lang.String key,
double threshold)
key - key of link annotationthreshold - threshold value of the specified link annotationpublic java.lang.String key()
public double threshold()
public boolean isValid(Link link, ResourceContext context)
BooleanConstraintisValid in class BooleanConstraintlink - link to be validatedcontext - resource context for checking available resourcespublic double cost(Link link, ResourceContext context)
BooleanConstraintcost in interface Constraintcost in class BooleanConstraintlink - link to be evaluatedcontext - resource context for validating availability of resourcespublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object