javamorph
Class CLine

java.lang.Object
  extended by javamorph.CLine

public class CLine
extends Object

Version:
1.1
Author:
claus.erhard.wimmer@googlemail.com
Program: JavaMorph V 1.1.
Class: CLine.
License: GPLv2.
Description: Line on a pixel picture.
Hint: Consisting of two points. Evaluation helper functions provided.

Field Summary
 int x1
          x of first point.
 int x2
          x of second point.
 int y1
          y of first point.
 int y2
          y of second point.
 
Constructor Summary
CLine(int x1, int y1, int x2, int y2)
          Constructor with numbers.
CLine(Point p1, Point p2)
          Constructor with two points.
 
Method Summary
 boolean cross(CLine other)
          Does one line cross the other?
 boolean equals(Object o)
          Both end points are identical.
 int hashCode()
          Hash code relating to equals.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x1

public int x1
x of first point.


x2

public int x2
x of second point.


y1

public int y1
y of first point.


y2

public int y2
y of second point.

Constructor Detail

CLine

public CLine(int x1,
             int y1,
             int x2,
             int y2)
Constructor with numbers.

Parameters:
x1 - X of first point.
y1 - Y of first point.
x2 - X of second point.
y2 - Y of second point.

CLine

public CLine(Point p1,
             Point p2)
Constructor with two points.

Parameters:
p1 - Complete first point.
p2 - Complete second point.
Method Detail

cross

public boolean cross(CLine other)
Does one line cross the other? Hint: Except endpoints.

Parameters:
other - The other line.
Returns:
true if crossing.

equals

public boolean equals(Object o)
Both end points are identical.

Overrides:
equals in class Object

hashCode

public int hashCode()
Hash code relating to equals.

Overrides:
hashCode in class Object