Class PAreaSizeF<S>
java.lang.Object
com.io7m.jregions.core.parameterized.sizes.PAreaSizeF<S>
- Type Parameters:
S- A phantom type parameter indicating the coordinate space of the area
- All Implemented Interfaces:
PAreaSizeFType<S>,AreaSizeValuesFType
public final class PAreaSizeF<S> extends java.lang.Object implements PAreaSizeFType<S>
The size of an area with
float coordinates.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPAreaSizeF.Builder<S>Builds instances of typePAreaSizeF. -
Method Summary
Modifier and Type Method Description static <S> PAreaSizeF.Builder<S>builder()Creates a builder forPAreaSizeF.static <S> PAreaSizeF<S>copyOf(PAreaSizeFType<S> instance)Creates an immutable copy of aPAreaSizeFTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofPAreaSizeFthat have equal attribute values.inthashCode()Computes a hash code from attributes:sizeX,sizeY.floatheight()Deprecated.UsesizeY()static <S> PAreaSizeF<S>of(float sizeX, float sizeY)Construct a new immutablePAreaSizeFinstance.floatsizeX()floatsizeY()java.lang.StringtoString()Prints the immutable valuePAreaSizeFwith attribute values.floatwidth()Deprecated.UsesizeX()PAreaSizeF<S>withSizeX(float value)Copy the current immutable object by setting a value for thesizeXattribute.PAreaSizeF<S>withSizeY(float 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.parameterized.sizes.PAreaSizeFType
checkPreconditions
-
Method Details
-
width
@Deprecated public float width()Deprecated.UsesizeX()- Specified by:
widthin interfaceAreaSizeValuesFType- Returns:
- The width of the area
-
height
@Deprecated public float height()Deprecated.UsesizeY()- Specified by:
heightin interfaceAreaSizeValuesFType- Returns:
- The height of the area
-
sizeX
public float sizeX()- Specified by:
sizeXin interfaceAreaSizeValuesFType- Specified by:
sizeXin interfacePAreaSizeFType<S>- Returns:
- The value of the
sizeXattribute
-
sizeY
public float sizeY()- Specified by:
sizeYin interfaceAreaSizeValuesFType- Specified by:
sizeYin interfacePAreaSizeFType<S>- 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 ofPAreaSizeFthat 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 valuePAreaSizeFwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
Construct a new immutablePAreaSizeFinstance.- Type Parameters:
S- generic parameter S- Parameters:
sizeX- The value for thesizeXattributesizeY- The value for thesizeYattribute- Returns:
- An immutable PAreaSizeF instance
-
copyOf
Creates an immutable copy of aPAreaSizeFTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Type Parameters:
S- generic parameter S- Parameters:
instance- The instance to copy- Returns:
- A copied immutable PAreaSizeF instance
-
builder
Creates a builder forPAreaSizeF.PAreaSizeF.<S>builder() .setSizeX(float) // requiredsizeX.setSizeY(float) // requiredsizeY.build();- Type Parameters:
S- generic parameter S- Returns:
- A new PAreaSizeF builder
-