Class PositionCriterion


  • public abstract class PositionCriterion
    extends java.lang.Object
    Defines a true/false test on a data position.
    Since:
    29 Jan 2014
    Author:
    Mark Taylor
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      static PositionCriterion createBlobCriterion​(uk.ac.starlink.ttools.plot2.Surface surface, java.awt.Shape blob)
      Returns a criterion to test whether point positions fall within a given shape in graphics coordinates.
      static PositionCriterion createBoundsCriterion​(uk.ac.starlink.ttools.plot2.Surface surface)
      Returns a criterion to test whether point positions fall within the plot bounds of a given surface.
      static PositionCriterion createPartialBoundsCriterion​(uk.ac.starlink.ttools.plot2.Surface surface)
      Returns a criterion to test whether partial positions fall within the plot bounds of a given surface.
      abstract boolean isIncluded​(double[] dpos)
      Evaluates the test for a data position.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PositionCriterion

        public PositionCriterion()
    • Method Detail

      • isIncluded

        public abstract boolean isIncluded​(double[] dpos)
        Evaluates the test for a data position.
        Parameters:
        dpos - data space coordinate array
        Returns:
        true iff the given position fits this criterion
      • createBoundsCriterion

        public static PositionCriterion createBoundsCriterion​(uk.ac.starlink.ttools.plot2.Surface surface)
        Returns a criterion to test whether point positions fall within the plot bounds of a given surface.
        Parameters:
        surface - plot surface
        Returns:
        new criterion
      • createPartialBoundsCriterion

        public static PositionCriterion createPartialBoundsCriterion​(uk.ac.starlink.ttools.plot2.Surface surface)
        Returns a criterion to test whether partial positions fall within the plot bounds of a given surface. These partial positions are things like histogram data, which have an X but not a Y graphics coordinate. For this case, either X or Y coordinate within the plot bounds counts as success.
        Parameters:
        surface - plot surface
        Returns:
        new criterion
      • createBlobCriterion

        public static PositionCriterion createBlobCriterion​(uk.ac.starlink.ttools.plot2.Surface surface,
                                                            java.awt.Shape blob)
        Returns a criterion to test whether point positions fall within a given shape in graphics coordinates.
        Parameters:
        surface - plot surface
        blob - test shape in graphics coordinates
        Returns:
        new criterion