diff options
Diffstat (limited to 'libjava/java/nio/channels/FileLock.java')
-rw-r--r-- | libjava/java/nio/channels/FileLock.java | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/libjava/java/nio/channels/FileLock.java b/libjava/java/nio/channels/FileLock.java index 866ed3997d1..629f5ef79ec 100644 --- a/libjava/java/nio/channels/FileLock.java +++ b/libjava/java/nio/channels/FileLock.java @@ -1,4 +1,4 @@ -/* FileLock.java -- +/* FileLock.java -- Copyright (C) 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -39,6 +39,7 @@ package java.nio.channels; import java.io.IOException; + /** * @since 1.4 */ @@ -48,42 +49,41 @@ public abstract class FileLock long position; long size; boolean shared; - + /** * Initializes the file lock. * * @exception IllegalArgumentException If the preconditions on the parameters do not hold */ - protected FileLock (FileChannel channel, long position, long size, - boolean shared) + protected FileLock(FileChannel channel, long position, long size, + boolean shared) { - if (position < 0 || - size < 0) - throw new IllegalArgumentException (); + if (position < 0 || size < 0) + throw new IllegalArgumentException(); this.channel = channel; this.position = position; this.size = size; this.shared = shared; } - + /** * Tells whether or not this lock is valid. */ public abstract boolean isValid(); - + /** * Releases this lock. * * @exception IOException If an error occurs * @exception ClosedChannelException If the locked channel is no longer open. */ - public abstract void release () throws IOException; - + public abstract void release() throws IOException; + /** * Returns the file channel upon whose file this lock is held. */ - public final FileChannel channel () + public final FileChannel channel() { return channel; } @@ -91,15 +91,15 @@ public abstract class FileLock /** * Tells whether this lock is shared. */ - public final boolean isShared () + public final boolean isShared() { return shared; - } + } /** * Tells whether or not this lock overlaps the given lock range. */ - public final boolean overlaps (long position, long size) + public final boolean overlaps(long position, long size) { if (position > this.position + this.size) return false; @@ -114,15 +114,15 @@ public abstract class FileLock * Returns the position within the file of the first byte of the * locked region. */ - public final long position () + public final long position() { return position; } - + /** * Returns the size of the locked region in bytes. */ - public final long size () + public final long size() { return size; } @@ -130,7 +130,7 @@ public abstract class FileLock /** * Returns a string describing the range, type, and validity of this lock. */ - public final String toString () + public final String toString() { return "file-lock:pos=" + position + "size=" + size; } |