Skip navigation links
Student Library
Copyright © 2010-2018 Virginia Tech.
student.testingsupport

Class GObjectFilter

    • Field Detail

      • and

        public final GObjectFilter.BinaryOperator and
        The "and" operator for combining filters, designed to be used in expressions like where.nameIs("...").and.enabledIs(true). This operator is implemented as a public field so that the simple .and. notation can be used as a connective between filters. If you want to use parentheses for grouping to define the right argument, see and(GObjectFilter) instead.
      • or

        public final GObjectFilter.BinaryOperator or
        The "or" operator for combining filters, designed to be used in expressions like where.locationIs(25, 25).or.textIs("def"). This operator is implemented as a public field so that the simple .or. notation can be used as a connective between filters. If you want to use parentheses for grouping to define the right argument, see or(GObjectFilter) instead.
    • Constructor Detail

      • GObjectFilter

        protected GObjectFilter(String description)
        Creates a new filter object. This constructor is not public, since all filters are expected to be created using operators rather than by calling new.
        Parameters:
        description - A string description of this filter, used in toString().
    • Method Detail

      • toString

        public String toString()
        Get a string representation of this filter.
        Overrides:
        toString in class Object
        Returns:
        A string representation of this filter.
      • and

        public final GObjectFilter and(GObjectFilter otherFilter)
        The "and" operator for combining filters, when you want to use parentheses to group its righthand argument. This method is designed to be used in expressions like where.textIs("abc").and(visibility(true).or.filledIs(true)). If you wish to use the .and. notation instead, leaving off the parentheses, see and(GObjectFilter).
        Parameters:
        otherFilter - The second argument to "and".
        Returns:
        A new filter object that represents "this AND otherFilter".
      • or

        public final GObjectFilter or(GObjectFilter otherFilter)
        The "or" operator for combining filters, when you want to use parentheses to group its righthand argument. This method is designed to be used in expressions like where.textIs("abc").or(visibilityIs(true).and.filledIs(true)). If you wish to use the .or. notation instead, leaving off the parentheses, see or(GObjectFilter).
        Parameters:
        otherFilter - The second argument to "or".
        Returns:
        A new filter object that represents "this OR otherFilter".
      • test

        public abstract boolean test(acm.graphics.GObject gobj)
        Evaluate whether a GObject matches this filter. This operation is intended to be overridden by each subclass to implement the actual check that a specific kind of filter performs.
        Parameters:
        gobj - The GObject to check
        Returns:
        true if the GObject matches this filter
Student Library
Copyright © 2010-2018 Virginia Tech.