Package com.landawn.abacus.util
Class Synchronized<T>
java.lang.Object
com.landawn.abacus.util.Synchronized<T>
- Type Parameters:
T
-
- Since:
- 0.8
- Author:
- Haiyang Li
-
Method Summary
Modifier and TypeMethodDescription<E extends Throwable>
voidaccept
(Throwables.Consumer<? super T, E> consumer) static <T,
E extends Throwable>
voidaccept
(T mutex, Throwables.Consumer<? super T, E> consumer) static <T,
U, E extends Throwable>
voidaccept
(T mutex, U u, Throwables.BiConsumer<? super T, ? super U, E> consumer) <R,
E extends Throwable>
Rapply
(Throwables.Function<? super T, ? extends R, E> function) static <T,
R, E extends Throwable>
Rapply
(T mutex, Throwables.Function<? super T, ? extends R, E> funciton) static <T,
U, R, E extends Throwable>
Rapply
(T mutex, U u, Throwables.BiFunction<? super T, ? super U, ? extends R, E> funciton) <R,
E extends Throwable>
Rcall
(Throwables.Callable<R, E> cmd) static <T,
R, E extends Throwable>
Rcall
(T mutex, Throwables.Callable<R, E> cmd) static <T> Synchronized<T>
on
(T mutex) <E extends Throwable>
voidrun
(Throwables.Runnable<E> cmd) static <T,
E extends Throwable>
voidrun
(T mutex, Throwables.Runnable<E> cmd) <E extends Throwable>
booleantest
(Throwables.Predicate<? super T, E> predicate) static <T,
E extends Throwable>
booleantest
(T mutex, Throwables.Predicate<? super T, E> predicate) static <T,
U, E extends Throwable>
booleantest
(T mutex, U u, Throwables.BiPredicate<? super T, ? super U, E> predicate)
-
Method Details
-
on
- Type Parameters:
T
-- Parameters:
mutex
-- Returns:
-
run
- Type Parameters:
T
-E
-- Parameters:
mutex
- to locked on.cmd
-- Throws:
E
- the e
-
call
- Type Parameters:
T
-R
-E
-- Parameters:
mutex
- to locked on.cmd
-- Returns:
- Throws:
E
- the e
-
test
public static <T,E extends Throwable> boolean test(T mutex, Throwables.Predicate<? super T, E> predicate) throws E- Type Parameters:
T
-E
-- Parameters:
mutex
- to locked on.predicate
-- Returns:
- Throws:
E
- the e
-
test
public static <T,U, boolean testE extends Throwable> (T mutex, U u, Throwables.BiPredicate<? super T, ? super U, throws EE> predicate) - Type Parameters:
T
-U
-E
-- Parameters:
mutex
- to locked on.u
-predicate
-- Returns:
- Throws:
E
- the e
-
accept
public static <T,E extends Throwable> void accept(T mutex, Throwables.Consumer<? super T, E> consumer) throws E- Type Parameters:
T
-E
-- Parameters:
mutex
- to locked on.consumer
-- Throws:
E
- the e
-
accept
public static <T,U, void acceptE extends Throwable> (T mutex, U u, Throwables.BiConsumer<? super T, ? super U, throws EE> consumer) - Type Parameters:
T
-U
-E
-- Parameters:
mutex
- to locked on.u
-consumer
-- Throws:
E
- the e
-
apply
public static <T,R, R applyE extends Throwable> (T mutex, Throwables.Function<? super T, ? extends R, throws EE> funciton) - Type Parameters:
T
-R
-E
-- Parameters:
mutex
- to locked on.funciton
-- Returns:
- Throws:
E
- the e
-
apply
public static <T,U, R applyR, E extends Throwable> (T mutex, U u, Throwables.BiFunction<? super T, ? super U, throws E? extends R, E> funciton) - Type Parameters:
T
-U
-R
-E
-- Parameters:
mutex
- to locked on.u
-funciton
-- Returns:
- Throws:
E
- the e
-
run
- Type Parameters:
E
-- Parameters:
cmd
-- Throws:
E
- the e
-
call
- Type Parameters:
R
-E
-- Parameters:
cmd
-- Returns:
- Throws:
E
- the e
-
test
- Type Parameters:
E
-- Parameters:
predicate
-- Returns:
- Throws:
E
- the e
-
accept
- Type Parameters:
E
-- Parameters:
consumer
-- Throws:
E
- the e
-
apply
public <R,E extends Throwable> R apply(Throwables.Function<? super T, ? extends R, throws EE> function) - Type Parameters:
R
-E
-- Parameters:
function
-- Returns:
- Throws:
E
- the e
-