Record Class TextureAtlasLayoutSelection
A null or blank algorithmId is the unset/native default:
no choice was ever made and the host's own packing runs. NATIVE_ALGORITHM_ID is the explicit native choice recorded when a
user picks the native entry or a caller selects nativeDefault() —
it resolves to native packing exactly like the unset state but stays
distinguishable from it, so a stored explicit choice is never mistaken for
"no selection yet". The "native" id is reserved: it can never be
registered by a plugin, so the explicit native choice can never collide with
a real algorithm. Any other non-null id is resolved against TextureAtlasLayoutAlgorithmRegistry at invocation time; an id that is not
currently registered falls back to the native algorithm rather than failing.
Selecting an algorithm never registers it, and registering an algorithm
never selects it.
parallel is a request forwarded to
TextureAtlasLayoutPlanner.plan(java.util.List, TextureAtlasLayoutConstraints, boolean);
algorithms that do not declare supportsParallel ignore it.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe reserved algorithm id for the explicit native choice. -
Constructor Summary
ConstructorsConstructorDescriptionTextureAtlasLayoutSelection(String algorithmId, boolean parallel) Creates an instance of aTextureAtlasLayoutSelectionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealgorithmIdrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisNative()static TextureAtlasLayoutSelectionbooleanparallel()Returns the value of theparallelrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NATIVE_ALGORITHM_ID
The reserved algorithm id for the explicit native choice. Registration of this id is rejected, so it always resolves to the host's native packing.- See Also:
-
-
Constructor Details
-
TextureAtlasLayoutSelection
Creates an instance of aTextureAtlasLayoutSelectionrecord class.- Parameters:
algorithmId- the value for thealgorithmIdrecord componentparallel- the value for theparallelrecord component
-
-
Method Details
-
nativeDefault
- Returns:
- the native default selection: no algorithm id, serial packing.
-
isNative
public boolean isNative()- Returns:
- whether this selection resolves to the host's native packing —
true for both the unset state (
nullid) and the explicit native choice (NATIVE_ALGORITHM_ID)
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
algorithmId
Returns the value of thealgorithmIdrecord component.- Returns:
- the value of the
algorithmIdrecord component
-
parallel
public boolean parallel()Returns the value of theparallelrecord component.- Returns:
- the value of the
parallelrecord component
-