Class LatencyConstraint

  • All Implemented Interfaces:
    Constraint

    @Beta
    public class LatencyConstraint
    extends Object
    implements Constraint
    Constraint that evaluates the latency through a path.
    • Constructor Detail

      • LatencyConstraint

        public LatencyConstraint​(Duration latency)
        Creates a new constraint to keep under specified latency through a path.
        Parameters:
        latency - latency to be kept
    • Method Detail

      • cost

        public double cost​(Link link,
                           ResourceContext context)
        Description copied from interface: Constraint
        Evaluates the specified link and provides the cost for its traversal.
        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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object