|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rit.draw.item.Size
public class Size
Class Size provides a size (width,height) for a DrawingItem.
| Constructor Summary | |
|---|---|
Size()
Construct a new size with width = height = 0. |
|
Size(double width,
double height)
Construct a new size with the given width and height. |
|
Size(Size theSize)
Construct a new size with the same width and height as the given size. |
|
| Method Summary | |
|---|---|
Size |
add(double incr)
Returns a new size equal to this size increased by the given amount in both width and height. |
Size |
add(double wincr,
double hincr)
Returns a new size equal to this size increased by the given amounts in width and height. |
Size |
ceil()
Returns a new size with its width and height set to the ceiling of this size's width and height, respectively. |
Size |
div(double scale)
Returns a new size equal to this size divided by the given scale factor. |
Size |
div(double wscale,
double hscale)
Returns a new size equal to this size divided by the given scale factors. |
boolean |
equals(Object obj)
Determine if this size is equal to the given object. |
int |
hashCode()
Returns a hash code for this size. |
double |
height()
Returns this size's height. |
Size |
mul(double scale)
Returns a new size equal to this size multiplied by the given scale factor. |
Size |
mul(double wscale,
double hscale)
Returns a new size equal to this size multiplied by the given scale factors. |
void |
readExternal(ObjectInput in)
Read this size from the given object input stream. |
Size |
sub(double decr)
Returns a new size equal to this size decreased by the given amount in both width and height. |
Size |
sub(double wdecr,
double hdecr)
Returns a new size equal to this size decreased by the given amounts in width and height. |
String |
toString()
Returns a string version of this size. |
double |
width()
Returns this size's width. |
void |
writeExternal(ObjectOutput out)
Write this size to the given object output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Size()
public Size(double width,
double height)
width - Width.height - Height.public Size(Size theSize)
theSize - Size to copy.| Method Detail |
|---|
public double width()
public double height()
public Size ceil()
public Size add(double incr)
incr - Increment.
public Size add(double wincr,
double hincr)
wincr - Width increment.hincr - Height increment.public Size sub(double decr)
decr - Decrement.
public Size sub(double wdecr,
double hdecr)
wdecr - Width decrement.hdecr - Height decrement.public Size mul(double scale)
scale - Scale factor.
public Size mul(double wscale,
double hscale)
wscale - Width scale factor.hscale - Height scale factor.public Size div(double scale)
scale - Scale factor.
public Size div(double wscale,
double hscale)
wscale - Width scale factor.hscale - Height scale factor.
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface Externalizableout - Object output stream.
IOException - Thrown if an I/O error occurred.
public void readExternal(ObjectInput in)
throws IOException
readExternal in interface Externalizablein - Object input stream.
IOException - Thrown if an I/O error occurred.public boolean equals(Object obj)
equals in class Objectobj - Object to test.
public int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||