Class V7<A>

java.lang.Object
fj.data.vector.V7<A>
All Implemented Interfaces:
Iterable<A>

public final class V7<A> extends Object implements Iterable<A>
A vector-7.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final P1<A>
     
    private final V6<A>
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    V7(P1<A> head, V6<A> tail)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <A> F<V7<A>,A>
    __1()
    A first-class function to get the first element of a vector.
    static <A> F<V7<A>,A>
    __2()
    A first-class function to get the second element of a vector.
    static <A> F<V7<A>,A>
    __3()
    A first-class function to get the third element of a vector.
    static <A> F<V7<A>,A>
    __4()
    A first-class function to get the fourth element of a vector.
    static <A> F<V7<A>,A>
    __5()
    A first-class function to get the fifth element of a vector.
    static <A> F<V7<A>,A>
    __6()
    A first-class function to get the sixth element of a vector.
    static <A> F<V7<A>,A>
    __7()
    A first-class function to get the seventh element of a vector.
    _1()
    Returns the first element of this vector.
    _2()
    Returns the second element of this vector.
    _3()
    Returns the third element of this vector.
    _4()
    Returns the fourth element of this vector.
    _5()
    Returns the fifth element of this vector.
    _6()
    Returns the sixth element of this vector.
    _7()
    Returns the seventh element of this vector.
    <B> V7<B>
    apply(V7<F<A,B>> vf)
    Performs function application within a vector (applicative functor pattern).
    static <A> V7<A>
    cons(P1<A> head, V6<A> tail)
    Creates a vector-7 from a head and a tail.
    final boolean
    equals(Object other)
     
    final int
     
    P1<A>
    Returns the first element of this vector, as a product-1.
    Returns an iterator for the elements of this vector.
    <B> V7<B>
    map(F<A,B> f)
    Maps the given function across this vector.
    P7<A,A,A,A,A,A,A>
    p()
    Returns a homogeneous product-7 equivalent to this vector.
    static <A> V7<A>
    p(P7<A,A,A,A,A,A,A> p)
    Creates a vector-7 from a homogeneous product-7.
    static <A> F<V7<A>,P7<A,A,A,A,A,A,A>>
    p_()
    Returns a function that transforms a vector-7 to the equivalent product-7.
    V6<A>
    Returns all but the first element of this vector, as a vector-6.
    Returns an array with the elements of this vector.
    Returns a nonempty list with the elements of this vector.
    Returns a stream of the elements of this vector.
    static <A> F<V7<A>,Stream<A>>
    Returns a function that transforms a vector-7 to a stream of its elements.
    V7<V2<A>>
    vzip(V7<A> bs)
    Zips this vector with the given vector to produce a vector of vectors.
    <B> V7<P2<A,B>>
    zip(V7<B> bs)
    Zips this vector with the given vector to produce a vector of pairs.
    <B, C> V7<C>
    zipWith(F<A,F<B,C>> f, V7<B> bs)
    Zips this vector with the given vector using the given function to produce a new vector.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Field Details

    • tail

      private final V6<A> tail
  • Constructor Details

    • V7

      private V7(P1<A> head, V6<A> tail)
  • Method Details

    • equals

      public final boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • p

      public static <A> V7<A> p(P7<A,A,A,A,A,A,A> p)
      Creates a vector-7 from a homogeneous product-7.
      Parameters:
      p - The product-7 from which to create a vector.
      Returns:
      A new vector-7.
    • cons

      public static <A> V7<A> cons(P1<A> head, V6<A> tail)
      Creates a vector-7 from a head and a tail.
      Parameters:
      head - The value to put as the first element of the vector.
      tail - The vector representing all but the first element of the new vector.
      Returns:
      The new vector.
    • _1

      public A _1()
      Returns the first element of this vector.
      Returns:
      the first element of this vector.
    • _2

      public A _2()
      Returns the second element of this vector.
      Returns:
      the second element of this vector.
    • _3

      public A _3()
      Returns the third element of this vector.
      Returns:
      the third element of this vector.
    • _4

      public A _4()
      Returns the fourth element of this vector.
      Returns:
      the fourth element of this vector.
    • _5

      public A _5()
      Returns the fifth element of this vector.
      Returns:
      the fifth element of this vector.
    • _6

      public A _6()
      Returns the sixth element of this vector.
      Returns:
      the sixth element of this vector.
    • _7

      public A _7()
      Returns the seventh element of this vector.
      Returns:
      the seventh element of this vector.
    • tail

      public V6<A> tail()
      Returns all but the first element of this vector, as a vector-6.
      Returns:
      all but the first element of this vector, as a vector-6.
    • head

      public P1<A> head()
      Returns the first element of this vector, as a product-1.
      Returns:
      the first element of this vector, as a product-1.
    • iterator

      public Iterator<A> iterator()
      Returns an iterator for the elements of this vector.
      Specified by:
      iterator in interface Iterable<A>
      Returns:
      an iterator for the elements of this vector.
    • p

      public P7<A,A,A,A,A,A,A> p()
      Returns a homogeneous product-7 equivalent to this vector.
      Returns:
      a homogeneous product-7 equivalent to this vector.
    • toNonEmptyList

      public NonEmptyList<A> toNonEmptyList()
      Returns a nonempty list with the elements of this vector.
      Returns:
      a nonempty list with the elements of this vector.
    • toStream

      public Stream<A> toStream()
      Returns a stream of the elements of this vector.
      Returns:
      a stream of the elements of this vector.
    • toArray

      public Array<A> toArray()
      Returns an array with the elements of this vector.
      Returns:
      an array with the elements of this vector.
    • map

      public <B> V7<B> map(F<A,B> f)
      Maps the given function across this vector.
      Parameters:
      f - The function to map across this vector.
      Returns:
      A new vector after the given function has been applied to each element.
    • apply

      public <B> V7<B> apply(V7<F<A,B>> vf)
      Performs function application within a vector (applicative functor pattern).
      Parameters:
      vf - The vector of functions to apply.
      Returns:
      A new vector after zipping the given vector of functions over this vector.
    • zipWith

      public <B, C> V7<C> zipWith(F<A,F<B,C>> f, V7<B> bs)
      Zips this vector with the given vector using the given function to produce a new vector.
      Parameters:
      f - The function to zip this vector and the given vector with.
      bs - The vector to zip this vector with.
      Returns:
      A new vector with the results of the function.
    • zip

      public <B> V7<P2<A,B>> zip(V7<B> bs)
      Zips this vector with the given vector to produce a vector of pairs.
      Parameters:
      bs - The vector to zip this vector with.
      Returns:
      A new vector with a length the same as the shortest of this vector and the given vector.
    • vzip

      public V7<V2<A>> vzip(V7<A> bs)
      Zips this vector with the given vector to produce a vector of vectors.
      Parameters:
      bs - The vector to zip this vector with.
      Returns:
      A new vector of vectors.
    • toStream_

      public static <A> F<V7<A>,Stream<A>> toStream_()
      Returns a function that transforms a vector-7 to a stream of its elements.
      Returns:
      a function that transforms a vector-7 to a stream of its elements.
    • p_

      public static <A> F<V7<A>,P7<A,A,A,A,A,A,A>> p_()
      Returns a function that transforms a vector-7 to the equivalent product-7.
      Returns:
      a function that transforms a vector-7 to the equivalent product-7.
    • __1

      public static <A> F<V7<A>,A> __1()
      A first-class function to get the first element of a vector.
      Returns:
      a function that gets the first element of a given vector.
    • __2

      public static <A> F<V7<A>,A> __2()
      A first-class function to get the second element of a vector.
      Returns:
      a function that gets the second element of a given vector.
    • __3

      public static <A> F<V7<A>,A> __3()
      A first-class function to get the third element of a vector.
      Returns:
      a function that gets the third element of a given vector.
    • __4

      public static <A> F<V7<A>,A> __4()
      A first-class function to get the fourth element of a vector.
      Returns:
      a function that gets the fourth element of a given vector.
    • __5

      public static <A> F<V7<A>,A> __5()
      A first-class function to get the fifth element of a vector.
      Returns:
      a function that gets the fifth element of a given vector.
    • __6

      public static <A> F<V7<A>,A> __6()
      A first-class function to get the sixth element of a vector.
      Returns:
      a function that gets the sixth element of a given vector.
    • __7

      public static <A> F<V7<A>,A> __7()
      A first-class function to get the seventh element of a vector.
      Returns:
      a function that gets the seventh element of a given vector.