java.lang.Object
de.linusdev.lutils.math.vector.Vector.View<FloatN>
de.linusdev.lutils.math.vector.abstracts.floatn.FloatN.View
All Implemented Interfaces:
FloatElements, FloatN, Vector
Direct Known Subclasses:
Float2.View, Float3.View, Float4.View, FloatN.FactorView
Enclosing interface:
FloatN

public abstract static class FloatN.View extends Vector.View<FloatN> implements FloatN
  • Constructor Details

    • View

      protected View(@NotNull @NotNull FloatN original, int @NotNull [] mapping)
  • Method Details

    • get

      public float get(int index)
      Description copied from interface: FloatN
      Get component at position index.
      Specified by:
      get in interface FloatN
      Parameters:
      index - index of the vector component to get
      Returns:
      component value
    • put

      public void put(int index, float value)
      Description copied from interface: FloatN
      Set component at position index to value.
      Specified by:
      put in interface FloatN
      Parameters:
      index - index of the vector component to set
      value - value to set
    • hasFactor

      public boolean hasFactor()
      Specified by:
      hasFactor in class Vector.View<FloatN>
      Returns:
      true if this view has a factor when getting/setting values.
    • getFactor

      public float @NotNull [] getFactor()
      Description copied from class: Vector.View
      The factor for each component. The factor[i] is used for the i-component of this view vector, not on the original.
      The returned array will always be of the same type as the vector (FloatN -> float[], ...).
      Overrides:
      getFactor in class Vector.View<FloatN>
      Returns:
      factor array
    • getAsView

      @NotNull public FloatN.View getAsView()
      Description copied from interface: Vector
      Used to avoid unsafe casting.
      Specified by:
      getAsView in interface FloatN
      Specified by:
      getAsView in interface Vector
      Overrides:
      getAsView in class Vector.View<FloatN>
      Returns:
      the vector itself, but as Vector.View.
    • toString

      public String toString()
      Overrides:
      toString in class Object