Buffer.java, [...]: Fixed javadocs and jalopied all over java.nio.
2004-04-20 Michael Koch <konqueror@gmx.de> * java/nio/Buffer.java, java/nio/channels/AlreadyConnectedException.java, java/nio/channels/AsynchronousCloseException.java, java/nio/channels/ByteChannel.java, java/nio/channels/CancelledKeyException.java, java/nio/channels/Channel.java, java/nio/channels/Channels.java, java/nio/channels/ClosedByInterruptException.java, java/nio/channels/ClosedChannelException.java, java/nio/channels/ClosedSelectorException.java, java/nio/channels/ConnectionPendingException.java, java/nio/channels/DatagramChannel.java, java/nio/channels/FileChannel.java, java/nio/channels/FileLock.java, java/nio/channels/FileLockInterruptionException.java, java/nio/channels/GatheringByteChannel.java, java/nio/channels/IllegalBlockingModeException.java, java/nio/channels/IllegalSelectorException.java, java/nio/channels/InterruptibleChannel.java, java/nio/channels/NoConnectionPendingException.java, java/nio/channels/NonReadableChannelException.java, java/nio/channels/NonWritableChannelException.java, java/nio/channels/NotYetBoundException.java, java/nio/channels/NotYetConnectedException.java, java/nio/channels/OverlappingFileLockException.java, java/nio/channels/Pipe.java, java/nio/channels/ReadableByteChannel.java, java/nio/channels/ScatteringByteChannel.java, java/nio/channels/SelectableChannel.java, java/nio/channels/SelectionKey.java, java/nio/channels/Selector.java, java/nio/channels/ServerSocketChannel.java, java/nio/channels/SocketChannel.java, java/nio/channels/UnresolvedAddressException.java, java/nio/channels/UnsupportedAddressTypeException.java, java/nio/channels/WritableByteChannel.java, java/nio/channels/spi/AbstractInterruptibleChannel.java, java/nio/channels/spi/AbstractSelectableChannel.java, java/nio/channels/spi/AbstractSelectionKey.java, java/nio/channels/spi/AbstractSelector.java, java/nio/channels/spi/SelectorProvider.java, java/nio/charset/spi/CharsetProvider.java: Fixed javadocs and jalopied all over java.nio. From-SVN: r80909
This commit is contained in:
parent
08c5d75719
commit
92e1fe6748
43 changed files with 655 additions and 457 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue