You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/04/15 17:30:14 UTC
svn commit: r765241 -
/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileLockType.java
Author: mturk
Date: Wed Apr 15 15:30:14 2009
New Revision: 765241
URL: http://svn.apache.org/viewvc?rev=765241&view=rev
Log:
Add some javadocs
Modified:
commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileLockType.java
Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileLockType.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileLockType.java?rev=765241&r1=765240&r2=765241&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileLockType.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/io/FileLockType.java Wed Apr 15 15:30:14 2009
@@ -26,15 +26,19 @@
/** Shared lock. More than one process or thread can hold a shared lock
* at any given time. Essentially, this is a "read lock", preventing
* writers from establishing an exclusive lock.
+ * <br/>Defined integer value is: <code>1</code>
*/
SHARED( 1),
/** Exclusive lock. Only one process may hold an exclusive lock at any
* given time. This is analogous to a "write lock".
+ * <br/>Defined integer value is: <code>2</code>
*/
EXCLUSIVE(2),
- /** Do not block while acquiring the file lock */
+ /** Do not block while acquiring the file lock
+ * <br/>Defined integer value is: <code>0x0010</code>
+ */
NONBLOCK( 0x0010);
private int value;
@@ -43,11 +47,17 @@
value = v;
}
+ /** Integer representing the value of this Enum.
+ */
public int valueOf()
{
return value;
}
+ /** Integer representing the sum of the integer values
+ * of the <code>FileLockType</code> enums.
+ * @param set The <code>EnumSet</code> which values to get.
+ */
public static int bitmapOf(EnumSet<FileLockType> set)
{
int bitmap = 0;
@@ -58,6 +68,11 @@
return bitmap;
}
+ /** Returns <code>EnumSet</code> of <code>FileLockType</code> enums
+ * from the integer bitmap value.
+ * @param value Integer used to construct the <code>EnumSet</code>
+ * with <code>FileLockType</code> values mathching the value flags.
+ */
public static EnumSet<FileLockType> valueOf(int value)
{
EnumSet<FileLockType> set = EnumSet.noneOf(FileLockType.class);