Dimension2D
class is to encapsulate a width
and a height dimension.
This class is only the abstract superclass for all objects that store a 2D dimension. The actual storage representation of the sizes is left to the subclass.
Access | Constructor and Description |
---|---|
protected |
Modifier and Type | Method and Description |
---|---|
public Object | Returns: a clone of this instance.Overrides java. |
public abstract double | Returns: the height of thisDimension .Returns the height of this |
public abstract double | Returns: the width of thisDimension .Returns the width of this |
public abstract void | setSize(double
the new width for the width, double Dimension
objectthe new height for the height)Dimension
objectSets the size of this |
public void | setSize(Dimension2D
the new size for the d)Dimension2D
objectSets the size of this |
Dimension2D | back to summary |
---|---|
protected Dimension2D() This is an abstract class that cannot be instantiated directly. Type-specific implementation subclasses are available for instantiation and provide a number of formats for storing the information necessary to satisfy the various accessor methods below.
|
clone | back to summary |
---|---|
public Object clone() Overrides java. Creates a new object of the same class as this object.
|
getHeight | back to summary |
---|---|
public abstract double getHeight() Returns the height of this
|
getWidth | back to summary |
---|---|
public abstract double getWidth() Returns the width of this
|
setSize | back to summary |
---|---|
public abstract void setSize(double width, double height) Sets the size of this
|
setSize | back to summary |
---|---|
public void setSize(Dimension2D d) Sets the size of this
|