org.apache.activemq.kaha.impl.async
Class DataFile

java.lang.Object
  extended by org.apache.activemq.util.LinkedNode
      extended by org.apache.activemq.kaha.impl.async.DataFile
All Implemented Interfaces:
Comparable<DataFile>
Direct Known Subclasses:
ReadOnlyDataFile

public class DataFile
extends LinkedNode
implements Comparable<DataFile>

DataFile


Field Summary
protected  Integer dataFileId
           
protected  File file
           
protected  int length
           
protected  int preferedSize
           
protected  int referenceCount
           
 
Fields inherited from class org.apache.activemq.util.LinkedNode
next, prev, tail
 
Method Summary
 void closeRandomAccessFile(RandomAccessFile file)
           
 int compareTo(DataFile df)
           
 int decrement()
           
 boolean delete()
           
 boolean equals(Object o)
           
 Integer getDataFileId()
           
 int getLength()
           
 int getReferenceCount()
           
 int hashCode()
           
 int increment()
           
 void incrementLength(int size)
           
 boolean isUnused()
           
 void move(File targetDirectory)
           
 RandomAccessFile openRandomAccessFile(boolean appender)
           
 void setLength(int length)
           
 String toString()
           
 
Methods inherited from class org.apache.activemq.util.LinkedNode
getHeadNode, getNext, getPrevious, getTailNode, isHeadNode, isTailNode, linkAfter, linkBefore, reset, unlink
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

file

protected final File file

dataFileId

protected final Integer dataFileId

preferedSize

protected final int preferedSize

length

protected int length

referenceCount

protected int referenceCount
Method Detail

getDataFileId

public Integer getDataFileId()

getLength

public int getLength()

setLength

public void setLength(int length)

incrementLength

public void incrementLength(int size)

increment

public int increment()

decrement

public int decrement()

getReferenceCount

public int getReferenceCount()

isUnused

public boolean isUnused()

toString

public String toString()
Overrides:
toString in class Object

openRandomAccessFile

public RandomAccessFile openRandomAccessFile(boolean appender)
                                      throws IOException
Throws:
IOException

closeRandomAccessFile

public void closeRandomAccessFile(RandomAccessFile file)
                           throws IOException
Throws:
IOException

delete

public boolean delete()
               throws IOException
Throws:
IOException

move

public void move(File targetDirectory)
          throws IOException
Throws:
IOException

compareTo

public int compareTo(DataFile df)
Specified by:
compareTo in interface Comparable<DataFile>

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.