TreeJuxtaposer
Class Point

java.lang.Object
  |
  +--TreeJuxtaposer.Point

class Point
extends java.lang.Object

A class representing a point in a plane. Has integer (pixel) (x,y) coordinates stored in (p[0],p[1]).

Author:
Yunhong Zhou
See Also:
AccordionDrawer.Tree, AccordionDrawer.TreeNode

Field Summary
private  int[] p
          private data
 
Constructor Summary
Point(int x1, int y1)
          Constructor
Point(Point pp)
          copy constructor
 
Method Summary
 java.lang.Object clone()
          to make a copy of the point
(package private)  boolean equals(Point pp)
          two points are equal if their corresponding coordinates are all equal
(package private)  int get(int i)
          Get one coordinate from the point object
(package private)  int length()
          the length of the p array should be 2
(package private)  void set(int i, int x)
           
 java.lang.String toString()
          output the point as a string
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

p

private int[] p
private data

Constructor Detail

Point

public Point(int x1,
             int y1)
Constructor

Parameters:
x1 - the first coordinate
y1 - the second coordinate

Point

public Point(Point pp)
copy constructor

Parameters:
pp - the pointed to be copied
Method Detail

get

int get(int i)
Get one coordinate from the point object

Parameters:
i - The parameter can only be either 0 or 1

set

void set(int i,
         int x)

equals

boolean equals(Point pp)
two points are equal if their corresponding coordinates are all equal


toString

public java.lang.String toString()
output the point as a string

Overrides:
toString in class java.lang.Object

length

int length()
the length of the p array should be 2


clone

public java.lang.Object clone()
to make a copy of the point

Overrides:
clone in class java.lang.Object