Class Point

java.lang.Object
fr.formiko.usuel.Point
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
Blade

public class Point extends Object implements Serializable, Cloneable
Point is a basic geometic shape.
In Formiko, it is used to store an x and an y in a single object.
Author:
Hydrolien
See Also:
Serialized Form
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
     
    protected int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Point​(int x, int y)
    A simple contructor.
    Point​(String s)
    A simple contructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addX​(int a)
     
    void
    addY​(int a)
     
    Standard clone function.
    boolean
    equals​(Object obj)
    Standard equals function.
    boolean
    equals​(String s)
    Equals methode for point.
    int
     
    int
     
    void
    setX​(int x)
     
    void
    setY​(int y)
     
    A simple toString function.

    Methods inherited from class java.lang.Object

    finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • x

      protected int x
    • y

      protected int y
  • Constructor Details

    • Point

      public Point(int x, int y)
      A simple contructor.
    • Point

      public Point(String s)
      A simple contructor.
      A Point can be create from a string that look like this :
      • 3,5
      • 78 -90
      • +467;+100
  • Method Details

    • getX

      public int getX()
    • getY

      public int getY()
    • setX

      public void setX(int x)
    • setY

      public void setY(int y)
    • addX

      public void addX(int a)
    • addY

      public void addY(int a)
    • toString

      public String toString()
      A simple toString function.
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Standard equals function. Null & other class type proof.
      Overrides:
      equals in class Object
      Parameters:
      obj - o is the Object to test. It can be null or something else than this class.
    • equals

      public boolean equals(String s)
      Equals methode for point.
      A Point can be compare to a string that look like this :
      • 3,5
      • 78 -90
      • +467;+100
    • clone

      public Point clone()
      Standard clone function.
      Overrides:
      clone in class Object