Class IntPoint

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class IntPoint
    extends java.awt.Point
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.awt.geom.Point2D

        java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float
    • Field Summary

      • Fields inherited from class java.awt.Point

        x, y
    • Constructor Summary

      Constructors 
      Constructor Description
      IntPoint​(int x, int y)
      Creates a point from given coordinates.
      IntPoint​(java.awt.geom.Point2D point)  
      IntPoint​(java.awt.Point point)
      Creates a point from a given integer point.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      IntPoint add​(int addX, int addY)
      Returns a point with this point's coordinates added with the given coordinates.
      IntPoint add​(java.awt.Point add)
      Returns a point with this point's coordinates added with the given point.
      IntPoint copy()
      Creates a new point from a given IntPoint point.
      IntPoint divide​(float f)  
      boolean equals​(java.lang.Object other)
      Tests whether this object represents the same point as another IntPoint
      float length()
      Returns the length of this point's vector.
      IntPoint multiply​(float mult)  
      IntPoint multiply​(int mult)
      Returns a point which is a multiplication of this point.
      IntPoint subtract​(int subX, int subY)
      Returns a point with this point's coordinates subtracted by the given coordinates.
      IntPoint subtract​(java.awt.geom.Point2D sub)
      Returns a point with this point's coordinates subtracted by the given point.
      java.lang.String toString()
      Returns a string representation of this object.
      java.awt.geom.Point2D unitVector()
      Returns the unit vector for this point's vector.
      void unparse​(java.io.Writer out)  
      • Methods inherited from class java.awt.Point

        getLocation, getX, getY, move, setLocation, setLocation, setLocation, translate
      • Methods inherited from class java.awt.geom.Point2D

        clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, hashCode, setLocation
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • IntPoint

        public IntPoint​(int x,
                        int y)
        Creates a point from given coordinates.
      • IntPoint

        public IntPoint​(java.awt.Point point)
        Creates a point from a given integer point.
      • IntPoint

        public IntPoint​(java.awt.geom.Point2D point)
    • Method Detail

      • copy

        public IntPoint copy()
        Creates a new point from a given IntPoint point.
      • subtract

        public IntPoint subtract​(int subX,
                                 int subY)
        Returns a point with this point's coordinates subtracted by the given coordinates.
      • subtract

        public IntPoint subtract​(java.awt.geom.Point2D sub)
        Returns a point with this point's coordinates subtracted by the given point.
      • add

        public IntPoint add​(int addX,
                            int addY)
        Returns a point with this point's coordinates added with the given coordinates.
      • add

        public IntPoint add​(java.awt.Point add)
        Returns a point with this point's coordinates added with the given point.
      • multiply

        public IntPoint multiply​(int mult)
        Returns a point which is a multiplication of this point.
      • multiply

        public IntPoint multiply​(float mult)
      • divide

        public IntPoint divide​(float f)
      • length

        public float length()
        Returns the length of this point's vector.
      • unitVector

        public java.awt.geom.Point2D unitVector()
        Returns the unit vector for this point's vector.
      • unparse

        public void unparse​(java.io.Writer out)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Returns a string representation of this object.
        Overrides:
        toString in class java.awt.Point
      • equals

        public boolean equals​(java.lang.Object other)
        Tests whether this object represents the same point as another IntPoint
        Overrides:
        equals in class java.awt.Point