Package com.io7m.smfj.core
Class SMFCoordinateSystem
- java.lang.Object
-
- com.io7m.smfj.core.SMFCoordinateSystem
-
- All Implemented Interfaces:
SMFCoordinateSystemType
public final class SMFCoordinateSystem extends java.lang.Object implements SMFCoordinateSystemType
The specification of a coordinate system and face winding order.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSMFCoordinateSystem.BuilderBuilds instances of typeSMFCoordinateSystem.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.io7m.jcoords.core.conversion.CAxisSystemaxes()static SMFCoordinateSystem.Builderbuilder()Creates a builder forSMFCoordinateSystem.static SMFCoordinateSystemcopyOf(SMFCoordinateSystemType instance)Creates an immutable copy of aSMFCoordinateSystemTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofSMFCoordinateSystemthat have equal attribute values.inthashCode()Computes a hash code from attributes:axes,windingOrder.static SMFCoordinateSystemof(com.io7m.jcoords.core.conversion.CAxisSystem axes, SMFFaceWindingOrder windingOrder)Construct a new immutableSMFCoordinateSysteminstance.java.lang.StringtoHumanString()java.lang.StringtoString()Prints the immutable valueSMFCoordinateSystemwith attribute values.SMFFaceWindingOrderwindingOrder()SMFCoordinateSystemwithAxes(com.io7m.jcoords.core.conversion.CAxisSystem value)Copy the current immutable object by setting a value for theaxesattribute.SMFCoordinateSystemwithWindingOrder(SMFFaceWindingOrder value)Copy the current immutable object by setting a value for thewindingOrderattribute.
-
-
-
Method Detail
-
axes
public com.io7m.jcoords.core.conversion.CAxisSystem axes()
- Specified by:
axesin interfaceSMFCoordinateSystemType- Returns:
- The coordinate system axes
-
windingOrder
public SMFFaceWindingOrder windingOrder()
- Specified by:
windingOrderin interfaceSMFCoordinateSystemType- Returns:
- The winding order for triangles
-
withAxes
public final SMFCoordinateSystem withAxes(com.io7m.jcoords.core.conversion.CAxisSystem value)
Copy the current immutable object by setting a value for theaxesattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for axes- Returns:
- A modified copy of the
thisobject
-
withWindingOrder
public final SMFCoordinateSystem withWindingOrder(SMFFaceWindingOrder value)
Copy the current immutable object by setting a value for thewindingOrderattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for windingOrder- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofSMFCoordinateSystemthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:axes,windingOrder.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueSMFCoordinateSystemwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
toHumanString
public java.lang.String toHumanString()
Returns a lazily initialized value of the
toHumanStringattribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
toHumanStringin interfaceSMFCoordinateSystemType- Returns:
- A lazily initialized value of the
toHumanStringattribute
-
of
public static SMFCoordinateSystem of(com.io7m.jcoords.core.conversion.CAxisSystem axes, SMFFaceWindingOrder windingOrder)
Construct a new immutableSMFCoordinateSysteminstance.- Parameters:
axes- The value for theaxesattributewindingOrder- The value for thewindingOrderattribute- Returns:
- An immutable SMFCoordinateSystem instance
-
copyOf
public static SMFCoordinateSystem copyOf(SMFCoordinateSystemType instance)
Creates an immutable copy of aSMFCoordinateSystemTypevalue. 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 SMFCoordinateSystem instance
-
builder
public static SMFCoordinateSystem.Builder builder()
Creates a builder forSMFCoordinateSystem.SMFCoordinateSystem.builder() .setAxes(com.io7m.jcoords.core.conversion.CAxisSystem) // optionalaxes.setWindingOrder(com.io7m.smfj.core.SMFFaceWindingOrder) // optionalwindingOrder.build();- Returns:
- A new SMFCoordinateSystem builder
-
-