Class ContainsConstraint


  • public class ContainsConstraint
    extends Constraint
    Constrain whether a QueryClass is member of a QueryReference or not. QueryReference can refer to an object or a collection, test whether QueryClass is a member of the collection or an instance of the object
    Author:
    Richard Smith, Mark Woodbridge, Matthew Wakeling
    • Constructor Detail

      • ContainsConstraint

        public ContainsConstraint​(QueryReference ref,
                                  ConstraintOp op,
                                  QueryClass cls)
        Constructor for ContainsConstraint.
        Parameters:
        ref - the target QueryReference
        op - specify CONTAINS or DOES_NOT_CONTAIN
        cls - the QueryClass to to be tested against reference
      • ContainsConstraint

        public ContainsConstraint​(QueryReference ref,
                                  ConstraintOp op,
                                  InterMineObject obj)
        Constructor for ContainsConstraint.
        Parameters:
        ref - the target QueryReference
        op - specify CONTAINS or DOES_NOT_CONTAIN
        obj - the InterMineObject to be tested against reference
      • ContainsConstraint

        public ContainsConstraint​(QueryReference ref,
                                  ConstraintOp op)
        Constructor for ContainsConstraint, constrain a reference/collection to be NULL/ NOT NULL
        Parameters:
        ref - the target QueryObjectReference or QueryCollectionReference
        op - specify IS_NULL or IS_NOT_NULL
    • Method Detail

      • getReference

        public QueryReference getReference()
        Returns the QueryReference of the constraint.
        Returns:
        the QueryReference
      • getQueryClass

        public QueryClass getQueryClass()
        Returns the QueryClass of the constraint.
        Returns:
        the QueryClass
      • getObject

        public InterMineObject getObject()
        Returns the InterMineObject of the constraint.
        Returns:
        the InterMineObject
      • equals

        public boolean equals​(java.lang.Object obj1)
        Test whether two ContainsConstraints are equal, overrides Object.equals()
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj1 - the object to compare with
        Returns:
        true if objects are equal
      • hashCode

        public int hashCode()
        Get the hashCode for this object, overrides Object.hashCode()
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hashCode
      • toString

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