Class MemberTuplePredicate

  • All Implemented Interfaces:
    StarPredicate

    public class MemberTuplePredicate
    extends Object
    implements StarPredicate
    Predicate which constrains a column to a particular member, or a range above or below a member, or a range between two members.
    Author:
    jhyde
    • Constructor Detail

      • MemberTuplePredicate

        public MemberTuplePredicate​(RolapCube baseCube,
                                    RolapMember lower,
                                    boolean lowerStrict,
                                    RolapMember upper,
                                    boolean upperStrict)
        Creates a MemberTuplePredicate which evaluates to true for a given range of members.

        The range can be open above or below, but at least one bound is required.

        Parameters:
        baseCube - base cube for virtual members
        lower - Member which forms the lower bound, or null if range is open below
        lowerStrict - Whether lower bound of range is strict
        upper - Member which forms the upper bound, or null if range is open above
        upperStrict - Whether upper bound of range is strict
      • MemberTuplePredicate

        public MemberTuplePredicate​(RolapCube baseCube,
                                    RolapCubeMember member)
        Creates a MemberTuplePredicate which evaluates to true for a given member.
        Parameters:
        baseCube - base cube for virtual members
        member - Member
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getConstrainedColumnBitKey

        public BitKey getConstrainedColumnBitKey()
        Description copied from interface: StarPredicate
        Returns a bitmap of constrained columns to speed up comparison
        Specified by:
        getConstrainedColumnBitKey in interface StarPredicate
        Returns:
        bitmap representing all constraining columns.
      • equalConstraint

        public boolean equalConstraint​(StarPredicate that)
        Description copied from interface: StarPredicate
        Returns whether this Predicate has the same constraining effect as the other constraint. This is weaker than Object.equals(Object): it is possible for two different members to constrain the same column in the same way.
        Specified by:
        equalConstraint in interface StarPredicate
        Parameters:
        that - Other predicate
        Returns:
        whether the other predicate is equivalent
      • minus

        public StarPredicate minus​(StarPredicate predicate)
        Description copied from interface: StarPredicate
        Returns the logical inverse of this Predicate. The result is a Predicate which holds whenever this predicate holds but the other does not.
        Specified by:
        minus in interface StarPredicate
        Parameters:
        predicate - Predicate
        Returns:
        Combined predicate
      • or

        public StarPredicate or​(StarPredicate predicate)
        Description copied from interface: StarPredicate
        Returns this union of this Predicate with another. The result is a Predicate which holds whenever either predicate holds.
        Specified by:
        or in interface StarPredicate
        Parameters:
        predicate - Predicate
        Returns:
        Combined predicate
      • and

        public StarPredicate and​(StarPredicate predicate)
        Description copied from interface: StarPredicate
        Returns this intersection of this Predicate with another. The result is a Predicate which holds whenever both predicates hold.
        Specified by:
        and in interface StarPredicate
        Parameters:
        predicate - Predicate
        Returns:
        Combined predicate
      • evaluate

        public boolean evaluate​(List<Object> valueList)
        Evaluates a constraint against a list of values.
        Specified by:
        evaluate in interface StarPredicate
        Parameters:
        valueList - List of values, one for each constrained column
        Returns:
        Whether constraint holds for given set of values
      • describe

        public void describe​(StringBuilder buf)
        Description copied from interface: StarPredicate
        Appends a description of this predicate to a StringBuilder. For example:
        • =any
        • =5
        • in (2, 4, 6)
        Specified by:
        describe in interface StarPredicate
        Parameters:
        buf - Builder to append to