insensa
Class CRasterFileInformation

java.lang.Object
  extended by insensa.CRasterFile
      extended by insensa.CRasterFileInformation
All Implemented Interfaces:
FileInspector, java.lang.Comparable<CRasterFileInformation>

public class CRasterFileInformation
extends CRasterFile
implements FileInspector, java.lang.Comparable<CRasterFileInformation>

Enthaelt informationen ueber ein Raster File incl. der verwendeten Option und Infos


Field Summary
private  ConnectionFileChanger connectionFileChanger
           
private  DependencyChecker depChecker
           
private  java.lang.String description
           
private  java.util.List<FileObserver> fileObserverList
           
private  java.util.List<InfoReader> infoReaders
           
private  CInfoReaderThreadPool iThreadPool
           
private  int lockedCnt
           
private  java.util.List<OptionFileChanger> options
           
private  COptionThreadPool optionThreadPool
           
private  java.lang.String outputFileName
           
private  ParentModule parent
           
private  java.lang.String separator
           
private  CRasterFileInformation targetRasterFile
           
private  CXmlRasterFileInformation xmlInformation
           
 
Constructor Summary
CRasterFileInformation(CRasterFileInformation oldFile, ParentModule parent, java.lang.String newOutputFileName, boolean keepOpen)
          Creates a new CRasterFileInformation as a copy of another, with new OutputFilePath and OutputFileName.
CRasterFileInformation(ParentModule parent, java.lang.String outputFileName, java.lang.String fullName, ConnectionDependencies conDep)
          Open existing File as CRasterFileInformation.
CRasterFileInformation(ParentModule parent, java.lang.String outputFileName, java.lang.String fullName, OptionFileChanger option, ConnectionDependencies conDep)
           
CRasterFileInformation(java.lang.String newAbsoluteFilePath, CRasterFileInformation oldFile, ParentModule parent, boolean copyInfos, boolean copyOptions, boolean keepOpen)
          Create a new File Instance and copy all Options and Infos from CRasterFile and CRasterFileInformation The Path of the new File instance is the path of newAbsoluteFilePath The XML Information for the new File is the same as for the old file, no need to change this.
 
Method Summary
 void addFileObserver(FileObserver fObservr)
          TODO TEST BUG 1002 F�gt neuen Observer hinzu.
 boolean addInfoReader(InfoReader info, boolean serialize)
          Add the info Inforeader Object to this File.
 void addInfoReaders(java.util.List<InfoReader> infos, boolean serialize)
          Add all InfoReader Objects in infos to this File.
 void addOption(OptionFileChanger option)
           
 void changeOutputFileName(java.lang.String newOutputFileName)
          set the new output file name and change the name of the xml config.
 void changeOutputFilePath(java.lang.String mOutputFilePath)
          Deletes the xml information an create a new one in the new path.
 int compareTo(CRasterFileInformation o)
          This compares the file names of the file reference first.
 boolean delete()
           
 boolean deleteFile()
           
 boolean deleteLink()
           
 boolean equals(java.lang.Object obj)
           
 void executeAllInfos(WorkerStatusList mWorkerStatusList)
          Execute all Unused InformationReader.
 void executeAllOptions(WorkerStatusList workerStatusList)
          Execute all Options in the Option List.
 void executeInfo(java.lang.String iReaderName, WorkerStatusList mWorkerStatusList)
           
 void executeInfos(java.util.List<java.lang.String> infoReaderList, WorkerStatusList mWorkerStatusList)
          Executes the read method on the first InfoReader Object.
 java.lang.String getAbsoluteOutputFilePath()
           
 ConnectionFileChanger getConnectionFileChanger()
           
 DependencyChecker getDepChecker()
           
 java.lang.String getDescription()
           
 java.util.List<FileObserver> getFileObserverList()
          TODO BUG 1002.
 InfoReader getInfoReader(java.lang.String infoReaderName)
           
 int getInfoReaderCount()
           
 java.util.List<InfoReader> getInfoReaders()
           
 CInfoReaderThreadPool getiThreadPool()
           
 int getOptionFileChangerCount()
           
 java.util.List<OptionFileChanger> getOptions()
           
 java.util.List<OptionFileChanger> getOptions(java.lang.String sOption)
           
 COptionThreadPool getOptionThreadPool()
           
 java.lang.String getOutputFileName()
           
 ParentModule getParentModule()
           
 java.lang.String getRelativePath()
           
 CRasterFileInformation getTargetRasterFile()
           
 int getUnusedInfoReaderCount()
           
 int getUnusedOptionCount()
           
 CXmlRasterFileInformation getXmlRasterFileInformation()
           
 int hashCode()
           
 boolean isHardCopy()
          be carefull.. rename a fileset causes this to be wring
 boolean isLocked()
           
 void notifyObserversDelete()
           
private  void readXmlRasterFileInformation(ConnectionDependencies connDep)
          loads the Information from the XML File.
 void relocateFile()
          crelocates the ref file if the path changed and the name did not!.
 void removeFileObserver(FileObserver fObs)
          TODO BUG 1002.
 void removeInfoReader(InfoReader iReader)
           
 void removeOptionFileChanger(OptionFileChanger option)
           
 boolean renameTo(java.io.File dest)
          just renames the file reference and saves dest as new file reference.
 void setConnectionFileChanger(ConnectionFileChanger conn)
           
 void setDescription(java.lang.String description)
           
 void setLock(boolean locked)
           
 void setOutputFileName(java.lang.String outputFileName)
           
 void setParentModule(ParentModule parentModule)
           
 void setTargetRasterFile(CRasterFileInformation targetRasterFile)
           
 void setXmlInformation(CXmlRasterFileInformation xmlInformation)
           
 java.lang.String toString()
           
 void update(CRasterFileInformation file)
           
 
Methods inherited from class insensa.CRasterFile
createFileCopy, createNewFile, exists, getAbsoluteFile, getAbsolutePath, getBand, getCellSize, getDataset, getDataType, getDatum, getDriver, getFileRef, getGeocentricCS, getGeographicCS, getGeoTransform, getName, getNCols, getNoDataValue, getNRows, getParent, getProjectedCS, getProjection, getProjectionWKT, getSpatialReference, getSpatialReferenceAttr, getSpheroid, getValues, getXllCorner, getYllCorner, refresh, relocateFile, setCellSize, setNCols, setNoDataValue, setNRows, setXllCorner, setYllCorner, unlock, writeNodataValue, writeNodataValueMax
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

options

private java.util.List<OptionFileChanger> options

infoReaders

private java.util.List<InfoReader> infoReaders

connectionFileChanger

private ConnectionFileChanger connectionFileChanger

description

private java.lang.String description

xmlInformation

private CXmlRasterFileInformation xmlInformation

targetRasterFile

private CRasterFileInformation targetRasterFile

depChecker

private DependencyChecker depChecker

iThreadPool

private CInfoReaderThreadPool iThreadPool

fileObserverList

private java.util.List<FileObserver> fileObserverList

optionThreadPool

private COptionThreadPool optionThreadPool

outputFileName

private java.lang.String outputFileName

lockedCnt

private int lockedCnt

parent

private ParentModule parent

separator

private java.lang.String separator
Constructor Detail

CRasterFileInformation

public CRasterFileInformation(CRasterFileInformation oldFile,
                              ParentModule parent,
                              java.lang.String newOutputFileName,
                              boolean keepOpen)
                       throws java.io.IOException,
                              CRasterFileException
Creates a new CRasterFileInformation as a copy of another, with new OutputFilePath and OutputFileName.

Parameters:
oldFile -
parent -
newOutputFileName -
keepOpen -
Throws:
java.io.IOException
org.jdom.JDOMException
CRasterFileException

CRasterFileInformation

public CRasterFileInformation(ParentModule parent,
                              java.lang.String outputFileName,
                              java.lang.String fullName,
                              ConnectionDependencies conDep)
                       throws java.io.IOException,
                              org.jdom.JDOMException,
                              CRasterFileException
Open existing File as CRasterFileInformation.

Parameters:
parent -
outputFileName -
fullName -
conDep -
Throws:
java.io.IOException
org.jdom.JDOMException
CRasterFileException

CRasterFileInformation

public CRasterFileInformation(ParentModule parent,
                              java.lang.String outputFileName,
                              java.lang.String fullName,
                              OptionFileChanger option,
                              ConnectionDependencies conDep)
                       throws java.io.IOException,
                              CRasterFileException
Parameters:
parent -
outputFileName -
fullName -
option -
conDep -
Throws:
java.io.IOException
org.jdom.JDOMException
CRasterFileException

CRasterFileInformation

public CRasterFileInformation(java.lang.String newAbsoluteFilePath,
                              CRasterFileInformation oldFile,
                              ParentModule parent,
                              boolean copyInfos,
                              boolean copyOptions,
                              boolean keepOpen)
                       throws java.io.IOException,
                              org.jdom.JDOMException,
                              CRasterFileException
Create a new File Instance and copy all Options and Infos from CRasterFile and CRasterFileInformation The Path of the new File instance is the path of newAbsoluteFilePath The XML Information for the new File is the same as for the old file, no need to change this. VIELLEICHT DOCH ???? TEST

Parameters:
newAbsoluteFilePath -
oldFile -
parent -
copyInfos -
copyOptions -
keepOpen -
Throws:
java.io.IOException
org.jdom.JDOMException
CRasterFileException
Method Detail

addFileObserver

public void addFileObserver(FileObserver fObservr)
TODO TEST BUG 1002 F�gt neuen Observer hinzu.

Parameters:
fObservr -

addInfoReader

public boolean addInfoReader(InfoReader info,
                             boolean serialize)
                      throws java.io.IOException
Add the info Inforeader Object to this File.

Parameters:
info -
serialize -
Returns:
true if the new InfoReader could be added, false otherwise
Throws:
java.io.IOException

addInfoReaders

public void addInfoReaders(java.util.List<InfoReader> infos,
                           boolean serialize)
                    throws java.io.IOException
Add all InfoReader Objects in infos to this File.

Parameters:
infos -
serialize -
Throws:
java.io.IOException

addOption

public void addOption(OptionFileChanger option)
               throws java.io.IOException
Parameters:
option -
Throws:
java.io.IOException

changeOutputFileName

public void changeOutputFileName(java.lang.String newOutputFileName)
                          throws java.io.IOException
set the new output file name and change the name of the xml config.

Parameters:
newOutputFileName -
Throws:
java.io.IOException

changeOutputFilePath

public void changeOutputFilePath(java.lang.String mOutputFilePath)
                          throws java.io.IOException
Deletes the xml information an create a new one in the new path.

Parameters:
mOutputFilePath -
Throws:
java.io.IOException

delete

public boolean delete()
Overrides:
delete in class CRasterFile
Returns:
See Also:
CRasterFile.delete()

deleteFile

public boolean deleteFile()
Returns:

deleteLink

public boolean deleteLink()
Returns:

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
Parameters:
obj -
Returns:
See Also:
Object.equals(java.lang.Object)

compareTo

public int compareTo(CRasterFileInformation o)
This compares the file names of the file reference first. If the file references are equal, then the output file names and paths will be compared.

Specified by:
compareTo in interface java.lang.Comparable<CRasterFileInformation>
See Also:
Comparable.compareTo(java.lang.Object)

executeAllInfos

public void executeAllInfos(WorkerStatusList mWorkerStatusList)
                     throws java.io.IOException
Execute all Unused InformationReader.

Parameters:
mWorkerStatusList -
Throws:
java.io.IOException

executeAllOptions

public void executeAllOptions(WorkerStatusList workerStatusList)
                       throws java.io.IOException,
                              org.jdom.JDOMException
Execute all Options in the Option List.

Parameters:
workerStatusList -
Throws:
java.io.IOException
org.jdom.JDOMException

executeInfo

public void executeInfo(java.lang.String iReaderName,
                        WorkerStatusList mWorkerStatusList)
                 throws java.io.IOException
Parameters:
iReaderName -
mWorkerStatusList -
Throws:
java.io.IOException

executeInfos

public void executeInfos(java.util.List<java.lang.String> infoReaderList,
                         WorkerStatusList mWorkerStatusList)
                  throws java.io.IOException
Executes the read method on the first InfoReader Object.

Parameters:
infoReaderList -
mWorkerStatusList -
Throws:
java.io.IOException

getAbsoluteOutputFilePath

public java.lang.String getAbsoluteOutputFilePath()
Returns:
the absolute output path

getConnectionFileChanger

public ConnectionFileChanger getConnectionFileChanger()
Returns:

getDepChecker

public DependencyChecker getDepChecker()
Returns:

getDescription

public java.lang.String getDescription()
Returns:

getFileObserverList

public java.util.List<FileObserver> getFileObserverList()
TODO BUG 1002.

Returns:

getInfoReader

public InfoReader getInfoReader(java.lang.String infoReaderName)
Parameters:
infoReaderName -
Returns:

getInfoReaderCount

public int getInfoReaderCount()
Returns:
size of InfoReader List

getInfoReaders

public java.util.List<InfoReader> getInfoReaders()
Returns:
The List of InfoReader Object for this Files

getiThreadPool

public CInfoReaderThreadPool getiThreadPool()
Returns:

getOptionFileChangerCount

public int getOptionFileChangerCount()
Returns:

getOptions

public java.util.List<OptionFileChanger> getOptions()
Returns:

getOptions

public java.util.List<OptionFileChanger> getOptions(java.lang.String sOption)
Parameters:
sOption -
Returns:

getOptionThreadPool

public COptionThreadPool getOptionThreadPool()
Returns:

getOutputFileName

public java.lang.String getOutputFileName()
Returns:

getParentModule

public ParentModule getParentModule()
Returns:

getRelativePath

public java.lang.String getRelativePath()
Returns:

getTargetRasterFile

public CRasterFileInformation getTargetRasterFile()
Returns:

getUnusedInfoReaderCount

public int getUnusedInfoReaderCount()
Returns:

getUnusedOptionCount

public int getUnusedOptionCount()
Returns:

getXmlRasterFileInformation

public CXmlRasterFileInformation getXmlRasterFileInformation()
Returns:

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
See Also:
Object.hashCode()

isHardCopy

public boolean isHardCopy()
be carefull.. rename a fileset causes this to be wring

Returns:

isLocked

public boolean isLocked()
Specified by:
isLocked in interface FileInspector
Returns:
See Also:
FileInspector.isLocked()

notifyObserversDelete

public void notifyObserversDelete()

readXmlRasterFileInformation

private void readXmlRasterFileInformation(ConnectionDependencies connDep)
                                   throws java.io.IOException
loads the Information from the XML File.

Parameters:
connDep -
Throws:
java.io.IOException
org.jdom.JDOMException

relocateFile

public void relocateFile()
crelocates the ref file if the path changed and the name did not!.


removeFileObserver

public void removeFileObserver(FileObserver fObs)
TODO BUG 1002.

Parameters:
fObs -

removeInfoReader

public void removeInfoReader(InfoReader iReader)
                      throws java.io.IOException
Parameters:
iReader -
Throws:
java.io.IOException

removeOptionFileChanger

public void removeOptionFileChanger(OptionFileChanger option)
                             throws java.io.IOException
Parameters:
option -
Throws:
java.io.IOException

renameTo

public boolean renameTo(java.io.File dest)
                 throws java.io.IOException
Description copied from class: CRasterFile
just renames the file reference and saves dest as new file reference.

Overrides:
renameTo in class CRasterFile
Parameters:
dest -
Returns:
Throws:
java.io.IOException
See Also:
CRasterFile.renameTo(java.io.File)

setConnectionFileChanger

public void setConnectionFileChanger(ConnectionFileChanger conn)
                              throws java.io.IOException
Parameters:
conn -
Throws:
java.io.IOException

setDescription

public void setDescription(java.lang.String description)
                    throws java.io.IOException
Parameters:
description -
Throws:
java.io.IOException

setLock

public void setLock(boolean locked)
Specified by:
setLock in interface FileInspector
Parameters:
locked -
See Also:
FileInspector.setLock(boolean)

setOutputFileName

public void setOutputFileName(java.lang.String outputFileName)
                       throws java.io.IOException
Parameters:
outputFileName -
Throws:
java.io.IOException

setParentModule

public void setParentModule(ParentModule parentModule)
Parameters:
parentModule -

setTargetRasterFile

public void setTargetRasterFile(CRasterFileInformation targetRasterFile)
Parameters:
targetRasterFile -

setXmlInformation

public void setXmlInformation(CXmlRasterFileInformation xmlInformation)
Parameters:
xmlInformation -

toString

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

update

public void update(CRasterFileInformation file)
Specified by:
update in interface FileInspector
Parameters:
file -
See Also:
FileInspector.update(insensa.CRasterFileInformation)