insensa.inforeader
Class CKMeansValues

java.lang.Object
  extended by insensa.inforeader.AbstractInfoReader
      extended by insensa.inforeader.CKMeansValues
All Implemented Interfaces:
InfoReader, java.io.Serializable, java.lang.Runnable

public class CKMeansValues
extends AbstractInfoReader

See Also:
Serialized Form

Field Summary
 java.util.List<InfoReader> iReaderList
           
 java.util.List<InfoReader> iReaderListDep
           
private  int numOfClasses
           
private  java.lang.String precisionString
           
private  java.util.List<ClassificationRange> rangeList
           
private static long serialVersionUID
           
 
Fields inherited from class insensa.inforeader.AbstractInfoReader
dependencer, processStatus, read, targetFile, workerStatus
 
Constructor Summary
CKMeansValues()
           
 
Method Summary
private  int calcClassCount(float[] data, int[] dataCounts, int fromIncl, int toIncl)
           
private  float calcMean(float[] data, int[] dataCounts, int classCounts, int fromIncl, int toIncl)
           
private  float[] calcMeans(java.util.Map<java.lang.Float,java.lang.Integer> dataMap, int[] counts, float[] ranges)
           
private  float[] calcMeans3(float[] data, int[] dataCounts, int[] classCounts, int[] places)
           
private  float calcSumOfVariances(float[] data, int[] dataCount, int[] places, int[] classCounts)
           
private  float calcSumOfVariances2(float[] data, int[] dataCount, int[] places)
           
private  float calcVariance(float[] data, int[] dataCounts, float mean, int classCounts, int fromIncl, int toIncl)
           
private  float getBreaks(java.util.Map<java.lang.Float,java.lang.Integer> dataMap, int numOfClasses2, java.util.List<ClassificationRange> equalRangeList, int numOfData)
           
private  float getBreaks2(java.util.Map<java.lang.Float,java.lang.Integer> dataMap, int numOfClasses2, java.util.List<ClassificationRange> equalRangeList, int numOfData)
           
private  float getBreaks3(java.util.Map<java.lang.Float,java.lang.Integer> dataMap, int numOfClasses2, java.util.List<ClassificationRange> equalRangeList, int numOfData)
           
 java.util.List<java.lang.String> getDependencies()
          Returns a list with names of InfoReaders that have to be executed before this InfoReader can be executed.
 org.jdom.Element getInfoElement()
           
 java.lang.String getInfoName()
           
 java.util.Vector<java.util.Vector<java.lang.String>> getInfos()
           
 int getNumOfClasses()
           
 java.util.List<ClassificationRange> getRangeList()
           
 java.util.List<VariableValue<java.lang.String>> getVariableList()
           
 void readInfos(CRasterFileInformation file)
          This method will try to receive all informations from dependent InfoReader You can get InfoReader with file.getInfoReader(nameOfInfoReader);
 void setInfos(org.jdom.Element eInfo)
          Restore saved data
 void setTargetFile(CRasterFileInformation targetFile)
          determines the target file for this InfoReader.
 void setUnread()
          Set InfoReader to unread to execute it again
 void setVariableList(java.util.List<VariableValue<java.lang.String>> variableList)
          Configure InfoReader
 java.lang.String toString()
          Note
Can be used to determine the human readable text for this InfoReader
.
 
Methods inherited from class insensa.inforeader.AbstractInfoReader
getErrorMassage, getPrecisionString, getTargetFile, isRead, run, setDependencyChecker, setWorkerStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

precisionString

private java.lang.String precisionString

numOfClasses

private int numOfClasses

rangeList

private java.util.List<ClassificationRange> rangeList

iReaderList

public java.util.List<InfoReader> iReaderList

iReaderListDep

public java.util.List<InfoReader> iReaderListDep
Constructor Detail

CKMeansValues

public CKMeansValues()
Method Detail

calcClassCount

private int calcClassCount(float[] data,
                           int[] dataCounts,
                           int fromIncl,
                           int toIncl)
Parameters:
data -
dataCounts -
fromIncl -
toIncl -
Returns:

calcMean

private float calcMean(float[] data,
                       int[] dataCounts,
                       int classCounts,
                       int fromIncl,
                       int toIncl)
Parameters:
data -
dataCounts -
classCounts -
fromIncl -
toIncl -
Returns:

calcMeans

private float[] calcMeans(java.util.Map<java.lang.Float,java.lang.Integer> dataMap,
                          int[] counts,
                          float[] ranges)
Parameters:
dataMap -
counts -
ranges -
Returns:

calcMeans3

private float[] calcMeans3(float[] data,
                           int[] dataCounts,
                           int[] classCounts,
                           int[] places)
Parameters:
data -
dataCounts -
classCounts -
places -
Returns:

calcSumOfVariances

private float calcSumOfVariances(float[] data,
                                 int[] dataCount,
                                 int[] places,
                                 int[] classCounts)
Parameters:
data -
dataCount -
places -
classCounts -
Returns:

calcSumOfVariances2

private float calcSumOfVariances2(float[] data,
                                  int[] dataCount,
                                  int[] places)
Parameters:
data -
dataCount -
places -
Returns:

calcVariance

private float calcVariance(float[] data,
                           int[] dataCounts,
                           float mean,
                           int classCounts,
                           int fromIncl,
                           int toIncl)
Parameters:
data -
dataCounts -
mean -
classCounts -
fromIncl -
toIncl -
Returns:

getBreaks

private float getBreaks(java.util.Map<java.lang.Float,java.lang.Integer> dataMap,
                        int numOfClasses2,
                        java.util.List<ClassificationRange> equalRangeList,
                        int numOfData)
Parameters:
dataMap -
numOfClasses2 -
equalRangeList -
numOfData -
Returns:

getBreaks2

private float getBreaks2(java.util.Map<java.lang.Float,java.lang.Integer> dataMap,
                         int numOfClasses2,
                         java.util.List<ClassificationRange> equalRangeList,
                         int numOfData)
Parameters:
dataMap -
numOfClasses2 -
equalRangeList -
numOfData -
Returns:

getBreaks3

private float getBreaks3(java.util.Map<java.lang.Float,java.lang.Integer> dataMap,
                         int numOfClasses2,
                         java.util.List<ClassificationRange> equalRangeList,
                         int numOfData)
Parameters:
dataMap -
numOfClasses2 -
equalRangeList -
numOfData -
Returns:

getDependencies

public java.util.List<java.lang.String> getDependencies()
Description copied from class: AbstractInfoReader
Returns a list with names of InfoReaders that have to be executed before this InfoReader can be executed.

Implementations of class AbstractInfoReader should override this method if dependencies are necessary. Example:
List<String> depList = super.getDependencies();
depList.add("countValues");
depList.add("equalBreaksValues");
return depList;

Specified by:
getDependencies in interface InfoReader
Overrides:
getDependencies in class AbstractInfoReader
Returns:
List<String>List with named of InfoReaders(dependencies) for this InfoReader
See Also:
AbstractInfoReader.getDependencies()

getInfoElement

public org.jdom.Element getInfoElement()
Specified by:
getInfoElement in interface InfoReader
Overrides:
getInfoElement in class AbstractInfoReader
Returns:
See Also:
AbstractInfoReader.getInfoElement()

getInfoName

public java.lang.String getInfoName()
Returns:
The name of this InfoReader
See Also:
InfoReader.getInfoName()

getInfos

public java.util.Vector<java.util.Vector<java.lang.String>> getInfos()
Returns:
Information to Display in Data Table
See Also:
InfoReader.getInfos()

getNumOfClasses

public int getNumOfClasses()
Returns:

getRangeList

public java.util.List<ClassificationRange> getRangeList()
Returns:

getVariableList

public java.util.List<VariableValue<java.lang.String>> getVariableList()
Specified by:
getVariableList in interface InfoReader
Overrides:
getVariableList in class AbstractInfoReader
Returns:
the variables that can be set or null if there is none
See Also:
AbstractInfoReader.getVariableList()

readInfos

public void readInfos(CRasterFileInformation file)
               throws java.io.FileNotFoundException,
                      java.io.IOException
Description copied from interface: InfoReader
This method will try to receive all informations from dependent InfoReader You can get InfoReader with file.getInfoReader(nameOfInfoReader);

Parameters:
file - File that holds this InfoReader
Throws:
java.io.FileNotFoundException
java.io.IOException
See Also:
InfoReader.readInfos(insensa.CRasterFileInformation)

setInfos

public void setInfos(org.jdom.Element eInfo)
              throws java.io.IOException
Description copied from interface: InfoReader
Restore saved data

Throws:
java.io.IOException
See Also:
InfoReader.setInfos(org.jdom.Element)

setTargetFile

public void setTargetFile(CRasterFileInformation targetFile)
Description copied from interface: InfoReader
determines the target file for this InfoReader.

Specified by:
setTargetFile in interface InfoReader
Overrides:
setTargetFile in class AbstractInfoReader
Parameters:
targetFile - Target file of type CRasterFileInformation for this InfoReader
See Also:
AbstractInfoReader.setTargetFile(insensa.CRasterFileInformation)

setUnread

public void setUnread()
Description copied from interface: InfoReader
Set InfoReader to unread to execute it again

Specified by:
setUnread in interface InfoReader
Overrides:
setUnread in class AbstractInfoReader
See Also:
AbstractInfoReader.setUnread()

setVariableList

public void setVariableList(java.util.List<VariableValue<java.lang.String>> variableList)
Description copied from interface: InfoReader
Configure InfoReader

Specified by:
setVariableList in interface InfoReader
Overrides:
setVariableList in class AbstractInfoReader
Parameters:
variableList - the List of Variables to be set
See Also:
AbstractInfoReader.setVariableList(java.util.List)

toString

public java.lang.String toString()
Description copied from class: AbstractInfoReader
Note
Can be used to determine the human readable text for this InfoReader
.

Overrides:
toString in class AbstractInfoReader
Returns:
a String that returns InfoReader.getInfoName() with the fist letter in upper case
See Also:
AbstractInfoReader.toString()