Class Result<T extends ConstJoltPhysicsObject>
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.template.Result<T>
- Type Parameters:
- T- the const datatype produced when successful
- All Implemented Interfaces:
- ConstJoltPhysicsObject,- AutoCloseable,- Comparable<JoltPhysicsObject>
- Direct Known Subclasses:
- BcsResult,- ConstraintResult,- GroupFilterResult,- PathResult,- PhysicsMaterialResult,- PhysicsSceneResult,- RagdollResult,- SbcsResult,- SettingsResult,- ShapeResult
The result of an operation that might fail.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabstract Tget()Return the result of a successful operation.getError()Return the error message.protected abstract StringgetError(long resultVa) Return the error message.booleanhasError()Test whether an error occurred.protected abstract booleanhasError(long resultVa) Test whether an error occurred.booleanisValid()Test whether the value returned byget()is valid.protected abstract booleanisValid(long resultVa) Test whether the value returned byget()is valid.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObjectclose, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
- 
Constructor Details- 
Resultprotected Result()Instantiate with no native object assigned.This no-arg constructor was made explicit to avoid javadoc warnings from JDK 18+. 
 
- 
- 
Method Details- 
getReturn the result of a successful operation.- Returns:
- a new JVM object with the pre-existing native object assigned
 
- 
getErrorReturn the error message.- Returns:
- a string of text
 
- 
hasErrorpublic boolean hasError()Test whether an error occurred.- Returns:
- trueif error, otherwise- false
 
- 
isValidpublic boolean isValid()Test whether the value returned byget()is valid.- Returns:
- trueif valid, otherwise- false
 
- 
getErrorReturn the error message.- Parameters:
- resultVa- the virtual address of the result (not zero)
- Returns:
- a string of text
 
- 
hasErrorprotected abstract boolean hasError(long resultVa) Test whether an error occurred.- Parameters:
- resultVa- the virtual address of the result (not zero)
- Returns:
- trueif error, otherwise- false
 
- 
isValidprotected abstract boolean isValid(long resultVa) Test whether the value returned byget()is valid.- Parameters:
- resultVa- the virtual address of the result (not zero)
- Returns:
- trueif valid, otherwise- false
 
 
-