org.geotoolkit.display.shape
Class FloatDimension2D

Object
  extended by Dimension2D
      extended by FloatDimension2D
All Implemented Interfaces:
Serializable, Cloneable

public class FloatDimension2D
extends Dimension2D
implements Serializable

Implements Dimension2D using single-precision floating point values.

Since:
2.0
Version:
3.00
Author:
Martin Desruisseaux (IRD)
See Also:
Serialized Form
Module:
referencing/geotk-referencing (download)    View source code for this class

Field Summary
 float height
          The height.
 float width
          The width.
 
Constructor Summary
FloatDimension2D()
          Constructs a new dimension initialized to (0,0).
FloatDimension2D(Dimension2D dimension)
          Constructs a new dimension initialized to the given dimension.
FloatDimension2D(float w, float h)
          Constructs a new dimension with the specified values.
 
Method Summary
 boolean equals(Object object)
          Compares this dimension with the given object for equality.
 double getHeight()
          Returns the height.
 double getWidth()
          Returns the width.
 int hashCode()
          Returns a hash code value for this dimension.
 void setSize(double w, double h)
          Sets width and height for this dimension.
 String toString()
          Returns a string representation of this dimension.
 
Methods inherited from class Dimension2D
clone, setSize
 
Methods inherited from class Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

width

public float width
The width.


height

public float height
The height.

Constructor Detail

FloatDimension2D

public FloatDimension2D()
Constructs a new dimension initialized to (0,0).


FloatDimension2D

public FloatDimension2D(Dimension2D dimension)
Constructs a new dimension initialized to the given dimension.

Parameters:
dimension - The dimension to copy.

FloatDimension2D

public FloatDimension2D(float w,
                        float h)
Constructs a new dimension with the specified values.

Parameters:
w - The width.
h - The height.
Method Detail

setSize

public void setSize(double w,
                    double h)
Sets width and height for this dimension.

Specified by:
setSize in class Dimension2D
Parameters:
w - The width.
h - The height.

getWidth

public double getWidth()
Returns the width.

Specified by:
getWidth in class Dimension2D

getHeight

public double getHeight()
Returns the height.

Specified by:
getHeight in class Dimension2D

hashCode

public int hashCode()
Returns a hash code value for this dimension.

Overrides:
hashCode in class Object

equals

public boolean equals(Object object)
Compares this dimension with the given object for equality.

Overrides:
equals in class Object
Parameters:
object - The object to compare with.
Returns:
true if this dimension is equal to the given object.

toString

public String toString()
Returns a string representation of this dimension.

Overrides:
toString in class Object


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.