Interface Vector

All Known Subinterfaces:
Float1, Float2, Float3, Float4, FloatN, Int1, Int2, Int3, Int4, IntN, Long1, Long2, Long3, Long4, LongN, Vector1, Vector2, Vector3, Vector4
All Known Implementing Classes:
ABFloat1, ABFloat2, ABFloat3, ABFloat4, ABFloatN, BBFloat1, BBFloat2, BBFloat3, BBFloat4, BBFloatN, BBInt1, BBInt2, BBInt3, BBInt4, BBIntN, BBLong1, BBLong2, BBLong3, BBLong4, BBLongN, BBVector, Float2.View, Float3.View, Float4.View, FloatN.View, Vector.View

public interface Vector
  • Method Details

    • recalculateMappingToOriginal

      static int @NotNull [] recalculateMappingToOriginal(@NotNull @NotNull Vector view, int @NotNull [] mapping)
      Used by view vectors to calculate the mapping directly to the original vectors if a view of a view vector is created.
      Parameters:
      view - the view vector, which the view should be created upon
      mapping - the mapping on the view vector
      Returns:
      mapping directly to the original vector
    • 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 for Vector subclasses.
      Type Parameters:
      T - Vector type.
      Parameters:
      vector - the Vector
      elementTypeName - the element type name of the vector
      getter - getter to get an element at a specific index
      Returns:
      nice string describing given vector
    • 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:
      true if this vector is array backed.
    • isBufferBacked

      boolean isBufferBacked()
      Whether this vector is buffer backed. If this method returns true, getStructure() will not throw an UnsupportedOperationException.
      Returns:
      true if this vector is buffer backed.
    • getStructure

      @NotNull default @NotNull Structure getStructure()
      Returns:
      this vector as Structure
      Throws:
      UnsupportedOperationException - if this vector is not buffer backed.
    • isView

      boolean isView()
      Whether this vector is only a view onto another vector.
      Returns:
      true if this vector is a view.
    • getOriginal

      @NotNull default @NotNull Vector getOriginal()
      Returns:
      the original vector this vector views to
      Throws:
      UnsupportedOperationException - if this vector is not a view on another vector.
    • getMapping

      default int @NotNull [] getMapping()
      The returned mapping must always map to a non view vector.
      Returns:
      the mapping to the original vector
      Throws:
      UnsupportedOperationException - if this vector is not a view on another vector.