Package com.io7m.smfj.core
Class SMFTriangles
- java.lang.Object
-
- com.io7m.smfj.core.SMFTriangles
-
- All Implemented Interfaces:
SMFTrianglesType
public final class SMFTriangles extends java.lang.Object implements SMFTrianglesType
Information about triangles in a mesh.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSMFTriangles.BuilderBuilds instances of typeSMFTriangles.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SMFTriangles.Builderbuilder()Creates a builder forSMFTriangles.static SMFTrianglescopyOf(SMFTrianglesType instance)Creates an immutable copy of aSMFTrianglesTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofSMFTrianglesthat have equal attribute values.inthashCode()Computes a hash code from attributes:triangleCount,triangleIndexSizeBits,triangleIndexSizeOctets,triangleSizeOctets.static SMFTrianglesof(long triangleCount, int triangleIndexSizeBits)Construct a new immutableSMFTrianglesinstance.java.lang.StringtoString()Prints the immutable valueSMFTriangleswith attribute values.longtriangleCount()inttriangleIndexSizeBits()inttriangleIndexSizeOctets()inttriangleSizeOctets()SMFTriangleswithTriangleCount(long value)Copy the current immutable object by setting a value for thetriangleCountattribute.SMFTriangleswithTriangleIndexSizeBits(int value)Copy the current immutable object by setting a value for thetriangleIndexSizeBitsattribute.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.io7m.smfj.core.SMFTrianglesType
checkPreconditions
-
-
-
-
Method Detail
-
triangleCount
public long triangleCount()
- Specified by:
triangleCountin interfaceSMFTrianglesType- Returns:
- The number of triangles in the file
-
triangleIndexSizeBits
public int triangleIndexSizeBits()
- Specified by:
triangleIndexSizeBitsin interfaceSMFTrianglesType- Returns:
- The size in bits of each triangle index
-
triangleIndexSizeOctets
public int triangleIndexSizeOctets()
- Specified by:
triangleIndexSizeOctetsin interfaceSMFTrianglesType- Returns:
- The size in octets of each triangle index
-
triangleSizeOctets
public int triangleSizeOctets()
- Specified by:
triangleSizeOctetsin interfaceSMFTrianglesType- Returns:
- The size in octets of each triangle
-
withTriangleCount
public final SMFTriangles withTriangleCount(long value)
Copy the current immutable object by setting a value for thetriangleCountattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for triangleCount- Returns:
- A modified copy of the
thisobject
-
withTriangleIndexSizeBits
public final SMFTriangles withTriangleIndexSizeBits(int value)
Copy the current immutable object by setting a value for thetriangleIndexSizeBitsattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for triangleIndexSizeBits- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofSMFTrianglesthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:triangleCount,triangleIndexSizeBits,triangleIndexSizeOctets,triangleSizeOctets.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueSMFTriangleswith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static SMFTriangles of(long triangleCount, int triangleIndexSizeBits)
Construct a new immutableSMFTrianglesinstance.- Parameters:
triangleCount- The value for thetriangleCountattributetriangleIndexSizeBits- The value for thetriangleIndexSizeBitsattribute- Returns:
- An immutable SMFTriangles instance
-
copyOf
public static SMFTriangles copyOf(SMFTrianglesType instance)
Creates an immutable copy of aSMFTrianglesTypevalue. 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 SMFTriangles instance
-
builder
public static SMFTriangles.Builder builder()
Creates a builder forSMFTriangles.SMFTriangles.builder() .setTriangleCount(long) // optionaltriangleCount.setTriangleIndexSizeBits(int) // optionaltriangleIndexSizeBits.build();- Returns:
- A new SMFTriangles builder
-
-