ambit2.core.io
Class FileState

Package class diagram package FileState
java.lang.Object
  extended by com.jgoodies.binding.beans.Model
      extended by ambit2.core.io.FileState
All Implemented Interfaces:
ambit2.base.interfaces.IInputOutputState, com.jgoodies.binding.beans.Observable, java.io.Serializable
Direct Known Subclasses:
FileInputState, FileOutputState

public class FileState
extends com.jgoodies.binding.beans.Model
implements ambit2.base.interfaces.IInputOutputState

This is to be able to verify if a file has changed since it has been last processed by FileBatchProcessing

See Also:
Serialized Form

Field Summary
protected  long currentRecord
           
protected  java.lang.String[] extensionDescriptions
           
protected  java.io.File file
           
protected  org.openscience.cdk.io.formats.IChemFormat fileFormat
           
protected  java.lang.String filename
           
protected  int hashCode
           
protected  long lastModified
           
protected  long length
           
protected static java.lang.String MSG_CANTCREATEFILE
           
protected static java.lang.String MSG_ERRORSAVE
           
protected static java.lang.String MSG_FILEDONOTEXISTS
           
protected static java.lang.String MSG_OPEN
           
protected static java.lang.String MSG_UNSUPPORTEDFORMAT
           
protected  long offset
           
protected  java.lang.String responseType
           
protected  java.lang.String[] supportedExtensions
           
 
Constructor Summary
FileState()
           
FileState(java.io.File file)
           
FileState(java.lang.String filename)
           
 
Method Summary
 java.io.File createFile()
           
 boolean equals(java.lang.Object obj)
           
 long getCurrentRecord()
           
 java.io.File getFile()
           
 java.lang.String getFilename()
           
 int getHashCode()
           
 long getLastModified()
           
 long getLength()
           
 long getOffset()
           
 java.lang.String getResponseType()
           
 java.lang.String[] getSupportedExtDescriptions()
           
 java.lang.String[] getSupportedExtensions()
           
 boolean match()
           
 boolean match(java.io.File file)
           
 void setCurrentRecord(long currentRecord)
           
 void setFile(java.io.File file)
           
 void setFilename(java.lang.String filename)
           
 void setHashCode(int hashCode)
           
 void setLastModified(long lastModified)
           
 void setLength(long length)
           
 void setOffset(long offset)
           
 void setResponseType(java.lang.String responseType)
           
 void setSupportedExtDescriptions(java.lang.String[] descr)
           
 void setSupportedExtensions(java.lang.String[] ext)
           
 java.lang.String toString()
           
 
Methods inherited from class com.jgoodies.binding.beans.Model
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, equals, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, fireMultiplePropertiesChanged, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MSG_FILEDONOTEXISTS

protected static transient java.lang.String MSG_FILEDONOTEXISTS

MSG_CANTCREATEFILE

protected static transient java.lang.String MSG_CANTCREATEFILE

MSG_OPEN

protected static transient java.lang.String MSG_OPEN

MSG_UNSUPPORTEDFORMAT

protected static transient java.lang.String MSG_UNSUPPORTEDFORMAT

MSG_ERRORSAVE

protected static transient java.lang.String MSG_ERRORSAVE

responseType

protected java.lang.String responseType

supportedExtensions

protected java.lang.String[] supportedExtensions

extensionDescriptions

protected java.lang.String[] extensionDescriptions

filename

protected java.lang.String filename

length

protected long length

lastModified

protected long lastModified

hashCode

protected int hashCode

file

protected transient java.io.File file

offset

protected long offset

currentRecord

protected long currentRecord

fileFormat

protected org.openscience.cdk.io.formats.IChemFormat fileFormat
Constructor Detail

FileState

public FileState()

FileState

public FileState(java.lang.String filename)

FileState

public FileState(java.io.File file)
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getFilename

public java.lang.String getFilename()
Returns:
Returns the filename.

setFilename

public void setFilename(java.lang.String filename)
Parameters:
filename - The filename to set.

getHashCode

public int getHashCode()
Returns:
Returns the hashCode.

setHashCode

public void setHashCode(int hashCode)
Parameters:
hashCode - The hashCode to set.

getLastModified

public long getLastModified()
Returns:
Returns the lastModified.

setLastModified

public void setLastModified(long lastModified)
Parameters:
lastModified - The lastModified to set.

getLength

public long getLength()
Returns:
Returns the length.

setLength

public void setLength(long length)
Parameters:
length - The length to set.

getFile

public java.io.File getFile()
Returns:
Returns the file.

setFile

public void setFile(java.io.File file)
Parameters:
file - The file to set.

getCurrentRecord

public long getCurrentRecord()
Specified by:
getCurrentRecord in interface ambit2.base.interfaces.IInputOutputState
Returns:
Returns the currentRecord.

setCurrentRecord

public void setCurrentRecord(long currentRecord)
Specified by:
setCurrentRecord in interface ambit2.base.interfaces.IInputOutputState
Parameters:
currentRecord - The currentRecord to set.

getOffset

public long getOffset()
Returns:
Returns the offset.

setOffset

public void setOffset(long offset)
Parameters:
offset - The offset to set.

match

public boolean match()
              throws ambit2.base.exceptions.AmbitIOException
Throws:
ambit2.base.exceptions.AmbitIOException

match

public boolean match(java.io.File file)

createFile

public java.io.File createFile()
                        throws ambit2.base.exceptions.AmbitIOException
Throws:
ambit2.base.exceptions.AmbitIOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getResponseType

public java.lang.String getResponseType()
Specified by:
getResponseType in interface ambit2.base.interfaces.IInputOutputState

setResponseType

public void setResponseType(java.lang.String responseType)
Specified by:
setResponseType in interface ambit2.base.interfaces.IInputOutputState

getSupportedExtensions

public java.lang.String[] getSupportedExtensions()

getSupportedExtDescriptions

public java.lang.String[] getSupportedExtDescriptions()

setSupportedExtensions

public void setSupportedExtensions(java.lang.String[] ext)

setSupportedExtDescriptions

public void setSupportedExtDescriptions(java.lang.String[] descr)