Class PathConstraintLoop


  • public class PathConstraintLoop
    extends PathConstraint
    Representation of a loop constraint in the PathQuery
    Author:
    Matthew Wakeling
    • Field Detail

      • VALID_OPS

        public static final java.util.Set<ConstraintOp> VALID_OPS
        List of valid ops for this type of constraint
    • Constructor Detail

      • PathConstraintLoop

        public PathConstraintLoop​(java.lang.String path,
                                  ConstraintOp op,
                                  java.lang.String loopPath)
        Constructs a new PathConstraintLoop from one path to another. The paths should be normal path expressions with dots separating the parts. Do not use colons to represent outer joins, and do not use square brackets to represent subclass constraints. The paths will be checked for format, but can only be verified once inside a PathQuery object by the PathQuery.verifyQuery() method. This object is used to form a loop constraint from one path to another.
        Parameters:
        path - the path that the constraint is attached to
        op - the type of operation
        loopPath - the path that the constraint is looped onto
        Throws:
        java.lang.NullPointerException - if path, op, or loopPath are null
        java.lang.IllegalArgumentException - if the paths contain colons or square brackets, or are otherwise in a bad format, or if the op is invalid for this constraint type
    • Method Detail

      • getLoopPath

        public java.lang.String getLoopPath()
        Returns the path that the constraint is constraining to.
        Returns:
        a String
      • getDescriptiveString

        public java.lang.String getDescriptiveString()
        Returns a descriptive string for this constraint, mainly useful for checking uniqueness.
        Returns:
        a String
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object