Package com.landawn.abacus.util
Class ShortPair
- java.lang.Object
-
- com.landawn.abacus.util.ShortPair
-
public final class ShortPair extends Object
The Class ShortPair.- Since:
- 1.2
- Author:
- Haiyang Li
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <E extends Exception>
voidaccept(Throwables.Consumer<? super PP,E> action)
<E extends Exception>
voidaccept(Throwables.ShortBiConsumer<E> action)
double
average()
boolean
equals(Object obj)
<E extends Exception>
u.Optional<PP>filter(Throwables.Predicate<? super PP,E> predicate)
<E extends Exception>
u.Optional<ShortPair>filter(Throwables.ShortBiPredicate<E> predicate)
<E extends Exception>
voidforEach(Throwables.ShortConsumer<E> comsumer)
int
hashCode()
<U,E extends Exception>
Umap(Throwables.Function<? super PP,U,E> mapper)
<U,E extends Exception>
Umap(Throwables.ShortBiFunction<U,E> mapper)
short
max()
short
min()
static ShortPair
of(short _1, short _2)
ShortPair
reverse()
ShortStream
stream()
int
sum()
short[]
toArray()
ShortList
toList()
u.Optional<PP>
toOptional()
String
toString()
-
-
-
Method Detail
-
of
public static ShortPair of(short _1, short _2)
- Parameters:
_1
- the 1_2
- the 2- Returns:
-
min
public short min()
- Returns:
-
max
public short max()
- Returns:
-
sum
public int sum()
- Returns:
-
average
public double average()
- Returns:
-
reverse
public ShortPair reverse()
- Returns:
-
toArray
public short[] toArray()
- Returns:
-
toList
public ShortList toList()
- Returns:
-
forEach
public <E extends Exception> void forEach(Throwables.ShortConsumer<E> comsumer) throws E extends Exception
- Type Parameters:
E
-- Parameters:
comsumer
-- Throws:
E
- the eE extends Exception
-
accept
public <E extends Exception> void accept(Throwables.ShortBiConsumer<E> action) throws E extends Exception
- Type Parameters:
E
-- Parameters:
action
-- Throws:
E
- the eE extends Exception
-
map
public <U,E extends Exception> U map(Throwables.ShortBiFunction<U,E> mapper) throws E extends Exception
- Type Parameters:
U
-E
-- Parameters:
mapper
-- Returns:
- Throws:
E
- the eE extends Exception
-
filter
public <E extends Exception> u.Optional<ShortPair> filter(Throwables.ShortBiPredicate<E> predicate) throws E extends Exception
- Type Parameters:
E
-- Parameters:
predicate
-- Returns:
- Throws:
E
- the eE extends Exception
-
stream
public ShortStream stream()
- Returns:
-
equals
public boolean equals(Object obj)
-
accept
public <E extends Exception> void accept(Throwables.Consumer<? super PP,E> action) throws E extends Exception
- Type Parameters:
E
-- Parameters:
action
-- Throws:
E
- the eE extends Exception
-
map
public <U,E extends Exception> U map(Throwables.Function<? super PP,U,E> mapper) throws E extends Exception
- Type Parameters:
U
-E
-- Parameters:
mapper
-- Returns:
- Throws:
E
- the eE extends Exception
-
filter
public <E extends Exception> u.Optional<PP> filter(Throwables.Predicate<? super PP,E> predicate) throws E extends Exception
- Type Parameters:
E
-- Parameters:
predicate
-- Returns:
- Throws:
E
- the eE extends Exception
-
toOptional
public u.Optional<PP> toOptional()
- Returns:
-
-