Package de.linusdev.lutils.math.vector
Interface Vector
- All Known Subinterfaces:
Float1,Float2,Float3,Float3x3,Float3xN,Float4,Float4x4,Float4xN,FloatMxN,FloatN,Int1,Int2,Int3,Int4,IntN,Long1,Long2,Long3,Long4,LongN,Matrix,Vector1,Vector2,Vector3,Vector4
- All Known Implementing Classes:
ABFloat1,ABFloat2,ABFloat3,ABFloat3x3,ABFloat4,ABFloat4x4,ABFloatMxN,ABFloatN,BBFloat1,BBFloat2,BBFloat3,BBFloat3x3,BBFloat4,BBFloat4x4,BBFloatMxN,BBFloatN,BBInt1,BBInt2,BBInt3,BBInt4,BBIntN,BBLong1,BBLong2,BBLong3,BBLong4,BBLongN,BBVector,Float2.FactorView,Float2.View,Float3.FactorView,Float3.View,Float4.FactorView,Float4.View,FloatN.FactorView,FloatN.View,Vector.View
public interface Vector
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault @NotNull Vector.View<?>Used to avoid unsafe casting.intCount of components in this vector.default @NotNull StructurebooleanWhether this vector is array backed.booleanWhether this vector is buffer backed.booleanisView()Whether this vector is only a view onto another vector.toString(T vector, @NotNull String elementTypeName, @NotNull BiFunction<T, Integer, Object> getter) toString()method forVectorsubclasses.
-
Method Details
-
toString
@NotNull static <T extends Vector> @NotNull String toString(@NotNull T vector, @NotNull @NotNull String elementTypeName, @NotNull @NotNull BiFunction<T, Integer, Object> getter) toString()method forVectorsubclasses. -
getMemberCount
int getMemberCount()Count of components in this vector.- Returns:
- float count in this vector
-
isArrayBacked
boolean isArrayBacked()Whether this vector is array backed.- Returns:
trueif this vector is array backed.
-
isBufferBacked
boolean isBufferBacked()Whether this vector is buffer backed. If this method returnstrue,getStructure()will not throw anUnsupportedOperationException.- Returns:
trueif this vector is buffer backed.
-
getStructure
- Returns:
- this vector as
Structure - Throws:
UnsupportedOperationException- if this vector is notbuffer backed.
-
isView
boolean isView()Whether this vector is only a view onto another vector.- Returns:
trueif this vector is a view.
-
getAsView
Used to avoid unsafe casting.- Returns:
- the vector itself, but as
Vector.View. - Throws:
UnsupportedOperationException- if this vector is not aview.
-