Search this API

y.geom
Class YDimension

java.lang.Object
  extended by y.geom.YDimension
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
YRectangle

public class YDimension
extends java.lang.Object
implements java.lang.Comparable

This class represents the size of an object. An instance of this class implements the immutable design pattern.

 

Field Summary
 double height
          The height of the dimension.
 double width
          The width of the dimension.
 
Constructor Summary
YDimension(double width, double height)
          Creates a new YDimension2D object for given size.
 
Method Summary
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object o)
          Tests a dimension to equality to another dimension.
 double getHeight()
          Get the height of the dimension object.
 double getWidth()
          Get the width of the dimension object.
 int hashCode()
           
 java.lang.String toString()
          Returns the size in the form: "W: width H: height"
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

width

public final double width
The width of the dimension.


height

public final double height
The height of the dimension.

Constructor Detail

YDimension

public YDimension(double width,
                  double height)
Creates a new YDimension2D object for given size.

Method Detail

getWidth

public final double getWidth()
Get the width of the dimension object.


getHeight

public final double getHeight()
Get the height of the dimension object.


equals

public boolean equals(java.lang.Object o)
Tests a dimension to equality to another dimension.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Returns the size in the form: "W: width H: height"

Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

© Copyright 2000-2021,
yWorks GmbH.
All rights reserved.