/** * Converts this pair to an object-based {@code Pair}. * * @return the object-based pair */ public Pair<Long, Double> toPair() { return Pair.of(first, second); }
/** * Obtains an instance from an {@code Object} and a {@code double}. * * @param <A> the first element type * @param first the first element * @param second the second element * @return a pair formed from the two parameters */ public static <A> ObjDoublePair<A> of(A first, double second) { return new ObjDoublePair<A>(first, second); }
/** * Obtains an instance from a {@code long} and a {@code double}. * * @param first the first element * @param second the second element * @return a pair formed from the two parameters */ public static LongDoublePair of(long first, double second) { return new LongDoublePair(first, second); }
/** * Obtains an instance from a {@code Pair}. * * @param <A> the first element type * @param pair the pair to convert * @return a pair formed by extracting values from the pair */ public static <A> ObjIntPair<A> ofPair(Pair<A, Integer> pair) { ArgChecker.notNull(pair, "pair"); return new ObjIntPair<A>(pair.getFirst(), pair.getSecond()); }
/** * Obtains an instance from a {@code Pair}. * * @param pair the pair to convert * @return a pair formed by extracting values from the pair */ public static IntDoublePair ofPair(Pair<Integer, Double> pair) { ArgChecker.notNull(pair, "pair"); return new IntDoublePair(pair.getFirst(), pair.getSecond()); }
@Override public DoublesPair build() { return new DoublesPair( first, second); }
@Override public IntDoublePair build() { return new IntDoublePair( first, second); }
@Override public ObjIntPair<A> build() { return new ObjIntPair<>( first, second); }
/** * Obtains a pair inferring the types. * * @param <A> the first element type * @param <B> the second element type * @param first the first element * @param second the second element * @return a pair formed from the two parameters */ public static <A, B> Pair<A, B> of(A first, B second) { return new Pair<>(first, second); }
@Override public Triple<A, B, C> build() { return new Triple<>( first, second, third); }
/** * Converts this pair to an object-based {@code Pair}. * * @return the object-based pair */ public Pair<Double, Double> toPair() { return Pair.of(first, second); }
@Override public ObjDoublePair<A> build() { return new ObjDoublePair<>( first, second); }
@Override public LongDoublePair build() { return new LongDoublePair( first, second); }
/** * Obtains an instance from two {@code double} elements. * * @param first the first element * @param second the second element * @return a pair formed from the two parameters */ public static DoublesPair of(double first, double second) { return new DoublesPair(first, second); }
/** * Obtains an instance from an {@code int} and a {@code double}. * * @param first the first element * @param second the second element * @return a pair formed from the two parameters */ public static IntDoublePair of(int first, double second) { return new IntDoublePair(first, second); }
/** * Obtains an instance from an {@code Object} and an {@code int}. * * @param <A> the first element type * @param first the first element * @param second the second element * @return a pair formed from the two parameters */ public static <A> ObjIntPair<A> of(A first, int second) { return new ObjIntPair<A>(first, second); }
@Override public Pair<A, B> build() { return new Pair<>( first, second); }
/** * Converts this pair to an object-based {@code Pair}. * * @return the object-based pair */ public Pair<Integer, Double> toPair() { return Pair.of(first, second); }
/** * Converts this pair to an object-based {@code Pair}. * * @return the object-based pair */ public Pair<A, Double> toPair() { return Pair.of(first, second); }
/** * Converts this pair to an object-based {@code Pair}. * * @return the object-based pair */ public Pair<A, Integer> toPair() { return Pair.of(first, second); }