insensa.connections
Class AbstractConnection

java.lang.Object
  extended by insensa.connections.AbstractConnection
All Implemented Interfaces:
ConnectionFileChanger, FileObserver, java.lang.Runnable
Direct Known Subclasses:
CAddition, CCoefficientOfVariation, CDivision, CErrorIndexation, CIndexation, CMean, CMultiplication, CSpearmanRankCorrelation, CStandardDeviation, CSubtraction, CThresholdVolatility, LinearRegression, PearsonCorrelation

public abstract class AbstractConnection
extends java.lang.Object
implements ConnectionFileChanger


Field Summary
static java.lang.String E_OUTPUT_NAME
           
static java.lang.String E_OUTPUT_PATH
           
protected  java.util.List<java.lang.String> fileNameList
           
protected  int id
           
static java.lang.String ID
           
static java.lang.String OUTPUT_NAME
           
static java.lang.String OUTPUT_SET
           
protected  CRasterFileInformation outputFile
           
protected  java.lang.String outputFileName
           
protected  CRasterFileSet outputFileSet
           
protected  java.util.List<CRasterFileInformation> rasterFileList
           
protected  java.lang.String separator
           
protected  boolean used
           
static java.lang.String USED
           
protected  WorkerStatus workerStatus
           
static java.lang.String XML_ELEMENT_FILE
           
 
Constructor Summary
AbstractConnection()
           
 
Method Summary
protected  void addAttributeValue(org.jdom.Element eCon, CRasterFileInformation rasterFile, java.lang.String attribute, java.lang.String value)
           
protected  void addElement(org.jdom.Element eCon, org.jdom.Element newElem, CRasterFileInformation rasterFile)
           
protected  boolean check()
           
protected  org.jdom.Element getChildElement(java.util.List<org.jdom.Element> leFiles, java.lang.String fileName)
           
 org.jdom.Element getConnectionElement()
          Build a xml Element with the attributes id used fileset name output file name source files full name (absolute) output name output path (relative) .
 AttributeTable getData()
           
 java.util.List<java.lang.String> getFileNameList()
           
 int getId()
           
 java.util.List<java.lang.String> getInfoDependencies()
           
 CRasterFileInformation getOutputFile()
           
 java.lang.String getOutputFileName()
           
 CRasterFileSet getOutputFileSet()
           
 java.util.List<CRasterFileInformation> getRasterFileList()
           
 java.util.List<java.lang.String> getSouceFileRelativePaths()
           
 java.util.List<CRasterFileInformation> getSourceFileList()
           
 java.util.List<VariableValue<?>> getVariableList()
           
 boolean isUsed()
           
 void notifyDelete(CRasterFileInformation subject)
           
 void run()
           
 void setConnectionElement(org.jdom.Element eCon)
          WARNING:
In case that this Connection is unused, you have to set the sourceFileList before invoking this function

.
 void setId(int id)
           
 void setOutputFile(CRasterFileInformation outputRasterFile)
           
 void setOutputFileName(java.lang.String outputFileName)
           
 void setOutputFileSet(CRasterFileSet outputSet)
           
 void setSourceFileList(java.util.List<CRasterFileInformation> sourceFileList)
           
 void setUsed(boolean used)
           
 void setVariableList(java.util.List<VariableValue<?>> varList)
           
 void setWorkerStatus(WorkerStatus workerStatus)
           
protected  void solveDependencies()
           
protected  void solveDependencies(java.util.List<CRasterFileInformation> actualRasterFileList)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface insensa.connections.ConnectionFileChanger
getConnectionName, write
 

Field Detail

USED

public static final java.lang.String USED
See Also:
Constant Field Values

ID

public static final java.lang.String ID
See Also:
Constant Field Values

OUTPUT_SET

public static final java.lang.String OUTPUT_SET
See Also:
Constant Field Values

OUTPUT_NAME

public static final java.lang.String OUTPUT_NAME
See Also:
Constant Field Values

E_OUTPUT_PATH

public static final java.lang.String E_OUTPUT_PATH
See Also:
Constant Field Values

E_OUTPUT_NAME

public static final java.lang.String E_OUTPUT_NAME
See Also:
Constant Field Values

XML_ELEMENT_FILE

public static final java.lang.String XML_ELEMENT_FILE
See Also:
Constant Field Values

used

protected boolean used

id

protected int id

outputFileName

protected java.lang.String outputFileName

outputFileSet

protected CRasterFileSet outputFileSet

workerStatus

protected WorkerStatus workerStatus

separator

protected java.lang.String separator

outputFile

protected CRasterFileInformation outputFile

rasterFileList

protected java.util.List<CRasterFileInformation> rasterFileList

fileNameList

protected java.util.List<java.lang.String> fileNameList
Constructor Detail

AbstractConnection

public AbstractConnection()
Method Detail

addAttributeValue

protected void addAttributeValue(org.jdom.Element eCon,
                                 CRasterFileInformation rasterFile,
                                 java.lang.String attribute,
                                 java.lang.String value)
Parameters:
eCon -
rasterFile -
attribute -
value -

addElement

protected void addElement(org.jdom.Element eCon,
                          org.jdom.Element newElem,
                          CRasterFileInformation rasterFile)
Parameters:
eCon -
newElem -
rasterFile -

check

protected boolean check()
                 throws java.io.IOException
Returns:
Throws:
java.io.IOException

getChildElement

protected org.jdom.Element getChildElement(java.util.List<org.jdom.Element> leFiles,
                                           java.lang.String fileName)
Parameters:
leFiles -
fileName -
Returns:

getConnectionElement

public org.jdom.Element getConnectionElement()
Build a xml Element with the attributes

getData

public AttributeTable getData()
Specified by:
getData in interface ConnectionFileChanger
Returns:
See Also:
ConnectionFileChanger.getData()

getFileNameList

public java.util.List<java.lang.String> getFileNameList()
Returns:

getId

public int getId()
Specified by:
getId in interface ConnectionFileChanger
Returns:
See Also:
ConnectionFileChanger.getId()

getInfoDependencies

public java.util.List<java.lang.String> getInfoDependencies()
Specified by:
getInfoDependencies in interface ConnectionFileChanger
Returns:
See Also:
ConnectionFileChanger.getInfoDependencies()

getOutputFile

public CRasterFileInformation getOutputFile()
Specified by:
getOutputFile in interface ConnectionFileChanger
Returns:
See Also:
ConnectionFileChanger.getOutputFile()

getOutputFileName

public java.lang.String getOutputFileName()
Specified by:
getOutputFileName in interface ConnectionFileChanger
Returns:
See Also:
ConnectionFileChanger.getOutputFileName()

getOutputFileSet

public CRasterFileSet getOutputFileSet()
Specified by:
getOutputFileSet in interface ConnectionFileChanger
Returns:
See Also:
ConnectionFileChanger.getOutputFileSet()

getRasterFileList

public java.util.List<CRasterFileInformation> getRasterFileList()
Returns:

getSourceFileList

public java.util.List<CRasterFileInformation> getSourceFileList()
Specified by:
getSourceFileList in interface ConnectionFileChanger
Returns:
See Also:
ConnectionFileChanger.getSourceFileList()

getSouceFileRelativePaths

public java.util.List<java.lang.String> getSouceFileRelativePaths()
                                                           throws java.io.IOException
Specified by:
getSouceFileRelativePaths in interface ConnectionFileChanger
Returns:
Throws:
java.io.IOException

getVariableList

public java.util.List<VariableValue<?>> getVariableList()
Specified by:
getVariableList in interface ConnectionFileChanger
Returns:
See Also:
ConnectionFileChanger.getVariableList()

isUsed

public boolean isUsed()
Specified by:
isUsed in interface ConnectionFileChanger
Returns:
See Also:
ConnectionFileChanger.isUsed()

notifyDelete

public void notifyDelete(CRasterFileInformation subject)
Specified by:
notifyDelete in interface FileObserver
See Also:
FileObserver.notifyDelete(insensa.CRasterFileInformation)

run

public void run()
Specified by:
run in interface java.lang.Runnable
See Also:
Runnable.run()

setConnectionElement

public void setConnectionElement(org.jdom.Element eCon)
                          throws java.io.IOException
WARNING:
In case that this Connection is unused, you have to set the sourceFileList before invoking this function

.

Specified by:
setConnectionElement in interface ConnectionFileChanger
Parameters:
eCon -
Throws:
java.io.IOException

setId

public void setId(int id)
Specified by:
setId in interface ConnectionFileChanger
See Also:
ConnectionFileChanger.setId(int)

setOutputFile

public void setOutputFile(CRasterFileInformation outputRasterFile)
Specified by:
setOutputFile in interface ConnectionFileChanger
See Also:
ConnectionFileChanger.setOutputFile(insensa.CRasterFileInformation)

setOutputFileName

public void setOutputFileName(java.lang.String outputFileName)
Specified by:
setOutputFileName in interface ConnectionFileChanger
See Also:
ConnectionFileChanger.setOutputFileName(java.lang.String)

setOutputFileSet

public void setOutputFileSet(CRasterFileSet outputSet)
Specified by:
setOutputFileSet in interface ConnectionFileChanger
See Also:
ConnectionFileChanger.setOutputFileSet(insensa.CRasterFileSet)

setSourceFileList

public void setSourceFileList(java.util.List<CRasterFileInformation> sourceFileList)
Specified by:
setSourceFileList in interface ConnectionFileChanger
See Also:
ConnectionFileChanger.setSourceFileList(java.util.List)

setUsed

public void setUsed(boolean used)
Specified by:
setUsed in interface ConnectionFileChanger
See Also:
ConnectionFileChanger.setUsed(boolean)

setVariableList

public void setVariableList(java.util.List<VariableValue<?>> varList)
Specified by:
setVariableList in interface ConnectionFileChanger
See Also:
ConnectionFileChanger.setVariableList(java.util.List)

setWorkerStatus

public void setWorkerStatus(WorkerStatus workerStatus)
Specified by:
setWorkerStatus in interface ConnectionFileChanger
See Also:
ConnectionFileChanger.setWorkerStatus(insensa.WorkerStatus)

solveDependencies

protected void solveDependencies()
                          throws java.io.IOException
Throws:
java.io.IOException

solveDependencies

protected void solveDependencies(java.util.List<CRasterFileInformation> actualRasterFileList)
                          throws java.io.IOException
Parameters:
actualRasterFileList -
Throws:
java.io.IOException

toString

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