Class AreaSizeD
java.lang.Object
com.io7m.jregions.core.unparameterized.sizes.AreaSizeD
- All Implemented Interfaces:
AreaSizeDType,AreaSizeValuesDType
public final class AreaSizeD extends java.lang.Object implements AreaSizeDType
The size of an area with
double coordinates.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAreaSizeD.BuilderBuilds instances of typeAreaSizeD. -
Method Summary
Modifier and Type Method Description static AreaSizeD.Builderbuilder()Creates a builder forAreaSizeD.static AreaSizeDcopyOf(AreaSizeDType instance)Creates an immutable copy of aAreaSizeDTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofAreaSizeDthat have equal attribute values.inthashCode()Computes a hash code from attributes:sizeX,sizeY.doubleheight()Deprecated.UsesizeY()static AreaSizeDof(double sizeX, double sizeY)Construct a new immutableAreaSizeDinstance.doublesizeX()doublesizeY()java.lang.StringtoString()Prints the immutable valueAreaSizeDwith attribute values.doublewidth()Deprecated.UsesizeX()AreaSizeDwithSizeX(double value)Copy the current immutable object by setting a value for thesizeXattribute.AreaSizeDwithSizeY(double value)Copy the current immutable object by setting a value for thesizeYattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.io7m.jregions.core.unparameterized.sizes.AreaSizeDType
checkPreconditions
-
Method Details
-
width
@Deprecated public double width()Deprecated.UsesizeX()- Specified by:
widthin interfaceAreaSizeValuesDType- Returns:
- The width of the area
-
height
@Deprecated public double height()Deprecated.UsesizeY()- Specified by:
heightin interfaceAreaSizeValuesDType- Returns:
- The height of the area
-
sizeX
public double sizeX()- Specified by:
sizeXin interfaceAreaSizeDType- Specified by:
sizeXin interfaceAreaSizeValuesDType- Returns:
- The value of the
sizeXattribute
-
sizeY
public double sizeY()- Specified by:
sizeYin interfaceAreaSizeDType- Specified by:
sizeYin interfaceAreaSizeValuesDType- Returns:
- The value of the
sizeYattribute
-
withSizeX
Copy the current immutable object by setting a value for thesizeXattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sizeX- Returns:
- A modified copy of the
thisobject
-
withSizeY
Copy the current immutable object by setting a value for thesizeYattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sizeY- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofAreaSizeDthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:sizeX,sizeY.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueAreaSizeDwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
Construct a new immutableAreaSizeDinstance.- Parameters:
sizeX- The value for thesizeXattributesizeY- The value for thesizeYattribute- Returns:
- An immutable AreaSizeD instance
-
copyOf
Creates an immutable copy of aAreaSizeDTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable AreaSizeD instance
-
builder
Creates a builder forAreaSizeD.AreaSizeD.builder() .setSizeX(double) // requiredsizeX.setSizeY(double) // requiredsizeY.build();- Returns:
- A new AreaSizeD builder
-