From a24c1042499f76ff2d442ae133ef165011a7af4c Mon Sep 17 00:00:00 2001 From: "Benjamin J. Culkin" Date: Mon, 12 Jul 2021 15:53:22 -0300 Subject: Formatting tweaks --- .../main/java/bjc/utils/funcutils/LambdaLock.java | 38 +++++++++------------- 1 file changed, 15 insertions(+), 23 deletions(-) (limited to 'base/src/main/java/bjc/utils/funcutils/LambdaLock.java') diff --git a/base/src/main/java/bjc/utils/funcutils/LambdaLock.java b/base/src/main/java/bjc/utils/funcutils/LambdaLock.java index f3637f9..46de182 100644 --- a/base/src/main/java/bjc/utils/funcutils/LambdaLock.java +++ b/base/src/main/java/bjc/utils/funcutils/LambdaLock.java @@ -5,12 +5,10 @@ import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.function.Supplier; -/** - * A wrapper around a {@link ReadWriteLock} to ensure that the lock is used +/** A wrapper around a {@link ReadWriteLock} to ensure that the lock is used * properly. * - * @author EVE - */ + * @author EVE */ public class LambdaLock { /* The read lock. */ private final Lock readLock; @@ -22,25 +20,21 @@ public class LambdaLock { this(new ReentrantReadWriteLock()); } - /** - * Create a new lambda-enabled lock. + /** Create a new lambda-enabled lock. * - * @param lck - * The lock to wrap. - */ + * @param lck The lock to wrap. */ public LambdaLock(final ReadWriteLock lck) { readLock = lck.readLock(); writeLock = lck.writeLock(); } - /** - * Execute an action with the read lock taken. + /** Execute an action with the read lock taken. * - * @param supp - * The action to call. + * @param The type of the result. * - * @return The result of the action. - */ + * @param supp The action to call. + * + * @return The result of the action. */ public T read(final Supplier supp) { readLock.lock(); @@ -51,14 +45,13 @@ public class LambdaLock { } } - /** - * Execute an action with the write lock taken. + /** Execute an action with the write lock taken. * - * @param supp - * The action to call. + * @param The type of the result. * - * @return The result of the action. - */ + * @param supp The action to call. + * + * @return The result of the action. */ public T write(final Supplier supp) { writeLock.lock(); @@ -72,8 +65,7 @@ public class LambdaLock { /** * Execute an action with the read lock taken. * - * @param action - * The action to call. + * @param action The action to call. */ public void read(final Runnable action) { readLock.lock(); -- cgit v1.2.3