Exemple #1
0
  /**
   * Creates a vector-5 from a homogeneous product-5.
   *
   * @param p The product-5 from which to create a vector.
   * @return A new vector-5.
   */
  public static <A> V5<A> p(final P5<A, A, A, A, A> p) {
    return new V5<A>(
        new P1<A>() {
          public A _1() {
            return p._1();
          }
        },
        V4.p(
            new P4<A, A, A, A>() {
              public A _1() {
                return p._2();
              }

              public A _2() {
                return p._3();
              }

              public A _3() {
                return p._4();
              }

              public A _4() {
                return p._5();
              }
            }));
  }
Exemple #2
0
 /**
  * @param loader application classloader
  * @param dexDir optimizedDirectory
  * @param files dexes
  * @throws IllegalArgumentException
  * @throws IllegalAccessException
  * @throws NoSuchFieldException
  * @throws InvocationTargetException
  * @throws NoSuchMethodException
  * @throws IOException
  */
 private static void installDexesAtFirst(ClassLoader loader, File dexDir, List<File> files)
     throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException,
         InvocationTargetException, NoSuchMethodException, IOException {
   //        if (!files.isEmpty()) {
   if (Build.VERSION.SDK_INT >= 19) {
     V19.install(loader, files, dexDir);
   } else if (Build.VERSION.SDK_INT >= 14) {
     V14.install(loader, files, dexDir);
   } else {
     V4.install(loader, files);
   }
   //        }
 }
Exemple #3
0
 /**
  * Returns the third element of this vector.
  *
  * @return the third element of this vector.
  */
 public A _3() {
   return tail._2();
 }
Exemple #4
0
 /**
  * Returns the second element of this vector.
  *
  * @return the second element of this vector.
  */
 public A _2() {
   return tail._1();
 }
Exemple #5
0
 /**
  * Performs function application within a vector (applicative functor pattern).
  *
  * @param vf The vector of functions to apply.
  * @return A new vector after zipping the given vector of functions over this vector.
  */
 public <B> V5<B> apply(final V5<F<A, B>> vf) {
   return new V5<B>(P1.<A, B>apply(head, vf.head()), tail.apply(vf.tail()));
 }
Exemple #6
0
 /**
  * Maps the given function across this vector.
  *
  * @param f The function to map across this vector.
  * @return A new vector after the given function has been applied to each element.
  */
 public <B> V5<B> map(final F<A, B> f) {
   return new V5<B>(head.map(f), tail.map(f));
 }
Exemple #7
0
 /**
  * Returns a nonempty list with the elements of this vector.
  *
  * @return a nonempty list with the elements of this vector.
  */
 public NonEmptyList<A> toNonEmptyList() {
   return NonEmptyList.nel(_1(), tail.toNonEmptyList().toList());
 }
Exemple #8
0
 /**
  * Returns the fifth element of this vector.
  *
  * @return the fifth element of this vector.
  */
 public A _5() {
   return tail._4();
 }
Exemple #9
0
 /**
  * Returns the fourth element of this vector.
  *
  * @return the fourth element of this vector.
  */
 public A _4() {
   return tail._3();
 }