Enum GeometryParsers

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<GeometryParsers>

    public enum GeometryParsers
    extends java.lang.Enum<GeometryParsers>
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      INSTANCE  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String... args)  
      double[] parseBox​(java.lang.CharSequence s)
      Parses a box.
      double[] parseCircle​(java.lang.CharSequence s)
      Parses a circle.
      double[] parseLine​(java.lang.CharSequence s)
      Parses an infinite line represented by the linear equation Ax + By + C = 0.
      double[] parseLSeg​(java.lang.CharSequence s)
      Parses a lseg.
      Path parsePath​(java.lang.CharSequence s)
      Parses a path.
      double[] parsePoint​(java.lang.CharSequence s)
      Parses a point.
      double[][] parsePolygon​(java.lang.CharSequence s)
      Parses a polygon.
      static GeometryParsers valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static GeometryParsers[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • values

        public static GeometryParsers[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (GeometryParsers c : GeometryParsers.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static GeometryParsers valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • parsePath

        public Path parsePath​(java.lang.CharSequence s)
        Parses a path.
         [ ( x1 , y1 ) , ... , ( xn , yn ) ]
         ( ( x1 , y1 ) , ... , ( xn , yn ) )
         ( x1 , y1 ) , ... , ( xn , yn )
         ( x1 , y1   , ... ,   xn , yn )
          x1 , y1   , ... ,   xn , yn
         
        Parameters:
        s - The path to parse.
        Returns:
        A Path.
      • parsePolygon

        public double[][] parsePolygon​(java.lang.CharSequence s)
        Parses a polygon.
         ( ( x1 , y1 ) , ... , ( xn , yn ) )
         ( x1 , y1 ) , ... , ( xn , yn )
         ( x1 , y1   , ... ,   xn , yn )
          x1 , y1   , ... ,   xn , yn
         
        Parameters:
        s - The polygon to parse.
        Returns:
        A list of points.
      • parseCircle

        public double[] parseCircle​(java.lang.CharSequence s)
        Parses a circle.
         < ( x , y ) , r >
         ( ( x , y ) , r )
         ( x , y ) , r
         x , y   , r
         
        Parameters:
        s - The circle to parse.
        Returns:
        [p.x, p.y, r]: A 3 elements array where the first 2 doubles represents a center point and the last element the radius.
      • parsePoint

        public double[] parsePoint​(java.lang.CharSequence s)
        Parses a point.
         ( x , y )
           x , y
         
        Parameters:
        s - The point to parse.
        Returns:
        [p.x, p.y]
      • parseBox

        public double[] parseBox​(java.lang.CharSequence s)
        Parses a box.
         ( ( x1 , y1 ) , ( x2 , y2 ) )
         ( x1 , y1 ) , ( x2 , y2 )
          x1 , y1   ,   x2 , y2
         
        Parameters:
        s - The box to parse.
        Returns:
        An array of size 4 (2 points.)
      • parseLSeg

        public double[] parseLSeg​(java.lang.CharSequence s)
        Parses a lseg.
         [ ( x1 , y1 ) , ( x2 , y2 ) ]
         ( ( x1 , y1 ) , ( x2 , y2 ) )
         ( x1 , y1 ) , ( x2 , y2 )
          x1 , y1   ,   x2 , y2
         
        Parameters:
        s - The lseg to parse.
        Returns:
        An array of size 4 (2 points.)
      • parseLine

        public double[] parseLine​(java.lang.CharSequence s)
        Parses an infinite line represented by the linear equation Ax + By + C = 0.
         { A, B, C }
         also accepted:
         [ ( x1 , y1 ) , ( x2 , y2 ) ]
         ( ( x1 , y1 ) , ( x2 , y2 ) )
         ( x1 , y1 ) , ( x2 , y2 )
          x1 , y1   ,   x2 , y2
         
        Parameters:
        s - The line to parse.
        Returns:
        An array of size 3 ([A,B,C] --> Ax+By+C=0.)
      • main

        public static void main​(java.lang.String... args)