Class BooleanConstraint

    • Constructor Detail

      • BooleanConstraint

        public BooleanConstraint()
    • Method Detail

      • isValid

        public abstract boolean isValid​(Link link,
                                        ResourceContext context)
        Returns true if the specified link satisfies the constraint.
        Parameters:
        link - link to be validated
        context - resource context for checking available resources
        Returns:
        true if link is viable
      • cost

        public double cost​(Link link,
                           ResourceContext context)
        Evaluates the specified link and provides the cost for its traversal. Negative return value means the specified link does not satisfy this constraint.
        Specified by:
        cost in interface Constraint
        Parameters:
        link - link to be evaluated
        context - resource context for validating availability of resources
        Returns:
        cost of link traversal
      • validate

        public boolean validate​(Path path,
                                ResourceContext context)
        Description copied from interface: Constraint
        Validates that the specified path satisfies the constraint.
        Specified by:
        validate in interface Constraint
        Parameters:
        path - path to be validated
        context - resource context for validating availability of resources
        Returns:
        cost of link traversal