com.ijchart.xychart.ui
Class Rectangle

java.lang.Object
  extended by com.ijchart.xychart.ui.Rectangle
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Rectangle
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Title: IJChart

Description: a chart library for the Java(tm) platform.

Construct a rectangle by width and height,this class is immutable.

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.
See Also:
Serialized Form

Field Summary
static Rectangle RECTANGLE_ZERO
           A rectangle with width and height are all 0.
 
Constructor Summary
Rectangle(double width, double height)
           Construct a rectangle by width and height.
 
Method Summary
 java.lang.Object clone()
           Override equals method.
 boolean equals(java.lang.Object obj)
           Override equals method.
 double getHeight()
           Returns the height of this rectangle.
 double getWidth()
           Returns the width of this rectangle.
 int hashCode()
           Override hashCode method.
 java.awt.geom.Rectangle2D toRectangle2D()
           Construct a java.awt.geom.Rectangle2D;x=0,y=0.
 java.lang.String toString()
           Override toString method.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RECTANGLE_ZERO

public static final Rectangle RECTANGLE_ZERO
A rectangle with width and height are all 0.

Constructor Detail

Rectangle

public Rectangle(double width,
                 double height)
Construct a rectangle by width and height.

Parameters:
width - double The width of this rectangle.
height - double The height of this rectangle.
Method Detail

getWidth

public double getWidth()
Returns the width of this rectangle.

Returns:
double The width of this rectangle.

getHeight

public double getHeight()
Returns the height of this rectangle.

Returns:
double The height of this rectangle.

toRectangle2D

public java.awt.geom.Rectangle2D toRectangle2D()
Construct a java.awt.geom.Rectangle2D;x=0,y=0.

Returns:
Rectangle2D

toString

public java.lang.String toString()
Override toString method.

Overrides:
toString in class java.lang.Object
Returns:
String

hashCode

public int hashCode()
Override hashCode method.

Overrides:
hashCode in class java.lang.Object
Returns:
int

equals

public boolean equals(java.lang.Object obj)
Override equals method.

Overrides:
equals in class java.lang.Object
Parameters:
obj - Object
Returns:
boolean

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Override equals method.

Overrides:
clone in class java.lang.Object
Returns:
Object
Throws:
java.lang.CloneNotSupportedException