Class ccj.Line
All Packages Class Hierarchy This Package Previous Next Index
Class ccj.Line
java.lang.Object
|
+----ccj.Shape
|
+----ccj.Line
- public class Line
- extends Shape
-
Line(Point, Point)
- Constructs a line object
-
clone()
- Creates a copy of this object
-
equals(Object)
- Tests if this object equals another
-
getEnd()
- Gets the ending point of the line
-
getStart()
- Gets the starting point of the line
-
hashCode()
- Computes a has code for this object
-
move(double, double)
- Moves this graphical shape
-
toString()
- Creates a string representation of this object
Line
public Line(Point s,
Point e)
- Constructs a line object
- Parameters:
- s - the starting point of the line
- e - the ending point of the line
move
public void move(double x,
double y)
- Moves this graphical shape
- Parameters:
- dx - the amount to move by in x direction
- dy - the amount to move by in y direction
clone
public Object clone()
- Creates a copy of this object
- Returns:
- a copy of this object
- Overrides:
- clone in class Shape
toString
public String toString()
- Creates a string representation of this object
- Returns:
- a string representation of this object
- Overrides:
- toString in class Object
equals
public boolean equals(Object b)
- Tests if this object equals another
- Parameters:
- b - the object to compare with
- Returns:
- true if the two objects are equal
- Overrides:
- equals in class Object
hashCode
public int hashCode()
- Computes a has code for this object
- Returns:
- a hash code for this object
- Overrides:
- hashCode in class Object
getStart
public Point getStart()
- Gets the starting point of the line
- Returns:
- the starting point of the line
getEnd
public Point getEnd()
- Gets the ending point of the line
- Returns:
- the ending point of the line
All Packages Class Hierarchy This Package Previous Next Index