org.jppf.io
Class AbstractDataLocation

java.lang.Object
  extended by org.jppf.io.AbstractDataLocation
All Implemented Interfaces:
DataLocation
Direct Known Subclasses:
ByteBufferLocation, FileLocation

public abstract class AbstractDataLocation
extends Object
implements DataLocation

Abstract implementation of the DataLocation interface.>br> This class provides default implementations for the transferFrom(ReadableByteChannel, boolean) and transferTo(WritableByteChannel, boolean) methods.

Author:
Laurent Cohen

Field Summary
protected  int size
          The capacity of the underlying buffer.
protected  boolean transferring
          Determines whether a transfer has been started.
 
Fields inherited from interface org.jppf.io.DataLocation
UNKNOWN_SIZE
 
Constructor Summary
AbstractDataLocation()
           
 
Method Summary
 int getSize()
          Get the size of the data referenced by this data location.
 void setSize(int size)
          Set the size of the data referenced by this data location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jppf.io.DataLocation
copy, getInputStream, getOutputStream, transferFrom, transferTo
 

Field Detail

size

protected int size
The capacity of the underlying buffer.


transferring

protected boolean transferring
Determines whether a transfer has been started.

Constructor Detail

AbstractDataLocation

public AbstractDataLocation()
Method Detail

getSize

public int getSize()
Get the size of the data referenced by this data location.

Specified by:
getSize in interface DataLocation
Returns:
the data size as an int.
See Also:
DataLocation.getSize()

setSize

public void setSize(int size)
Set the size of the data referenced by this data location.

Parameters:
size - - the data size as an int.


Copyright © 2005-2010 JPPF Team.