devisor2.foundation.base
Class DomainIO

java.lang.Object
  extended bydevisor2.foundation.base.BasicDomain
      extended bydevisor2.foundation.base.DomainStatistics
          extended bydevisor2.foundation.base.DomainIO
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Domain

public abstract class DomainIO
extends DomainStatistics

This class is an extended version of the original BasicDomain class which supports loading and saving the domain instance in one of the following formats: UCD, FEAT or FEAST.
See the MainActionListener for a description of how this class is used in contrast to the original Domain class.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class devisor2.foundation.base.BasicDomain
BasicDomain.DPoint
 
Field Summary
 
Fields inherited from class devisor2.foundation.base.BasicDomain
BoundaryEdgeCount, BoundaryNodeCount, cells, CellValueCount, changed, db, domainfileformat, domainfilename, ecke1, edges, FEAST, FEAT, name, nodes, NodeValueCount, perimeter, UCD, validpx, validpy
 
Constructor Summary
DomainIO()
           
 
Method Summary
static int checkFile(java.lang.String dateiname)
           
 int loadDomain(java.lang.String fileName, java.lang.String format)
          loads the given domain (convenience version)
 int loadDomain(java.lang.String fileName, java.lang.String format, boolean para, boolean grid)
          This method handles loading a domain.
 int loadDomainFEAST(java.lang.String fN)
           
 int loadDomainFEAT(java.lang.String fN, boolean para, boolean grid, boolean merge, double uoffx, double uoffy)
          loads a domain from files in FEAT format (name.prm, name.tri)
 int loadDomainFEAT(java.lang.String fN, boolean para, boolean grid, boolean merge, double uoffx, double uoffy, boolean redraw)
           
 int saveDomain(java.lang.String fileName, java.lang.String format, boolean check)
          Saves this domain with the specified filename and format.
 void saveDomainFEAT(java.lang.String fN)
          saves the domain in the FEAT format (name.prm, name.tri)
 void scanLine(java.lang.String t, java.lang.String format, double[] dret, int[] iret, java.lang.String[] sret)
           
 
Methods inherited from class devisor2.foundation.base.DomainStatistics
getStatistics, printCellVector, printDomain, printEdgeVector, printNodeVector
 
Methods inherited from class devisor2.foundation.base.BasicDomain
add, addCell, addEdge, addNode, adjustEdge, adjustEdge, adjustNode, centerDomain, centerDomain, centerDomain, construct_boundary, del, delCell, delEdge, delNode, draw, drawGrid, getBoundaryEdgeCount, getBoundaryNodeCount, getCell, getCellCount, getCells, getEdge, getEdgeCount, getEdgeForNode, getEdges, getFileformat, getFilename, getMaxParallelBlock, getName, getNearestCells, getNode, getNodeCount, getNodes, getNodeWithSameCoords, getParallelBlockCenter, getPerimeter, getPerimeter, hasChanged, isFeastable, rectifyElement, resetCellMarkers, resetEdgeMarkers, resetNodeMarkers, searchEdge, setDomainPerimeter, setName, updateAll, updateCellNeighbours, updateCellNodes, updateCellNumbers, updateEdgeNumbers, updateNodeNumbers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DomainIO

public DomainIO()
Method Detail

loadDomain

public int loadDomain(java.lang.String fileName,
                      java.lang.String format,
                      boolean para,
                      boolean grid)
This method handles loading a domain. Basically, it performs some checks and verifies the existence of the specified file.

Parameters:
fileName - - the full qualified path to the domain file
format - - one of the constants UCD, FEAT or FEAST
para - - flag to indicate if the prm file should be loaded
grid - - flag to indicate that the tri file should be loaded

loadDomain

public int loadDomain(java.lang.String fileName,
                      java.lang.String format)
loads the given domain (convenience version)

Parameters:
fileName - - full qualified path to the domain file(s)
format - - UCD, FEAT or FEAST

saveDomain

public int saveDomain(java.lang.String fileName,
                      java.lang.String format,
                      boolean check)
Saves this domain with the specified filename and format.

Parameters:
fileName - - full qualified path
format - one of the constants UCD, FEAT or FEAST
check - - flag to toggle the check for already existing files

checkFile

public static int checkFile(java.lang.String dateiname)

saveDomainFEAT

public void saveDomainFEAT(java.lang.String fN)
saves the domain in the FEAT format (name.prm, name.tri)


loadDomainFEAT

public int loadDomainFEAT(java.lang.String fN,
                          boolean para,
                          boolean grid,
                          boolean merge,
                          double uoffx,
                          double uoffy)
loads a domain from files in FEAT format (name.prm, name.tri)

Parameters:
para - boolean load name.prm file (parametrisation)
grid - boolean load name.tri file (grid description)
Returns:
=0 load succesfull, <>0 load error

loadDomainFEAT

public int loadDomainFEAT(java.lang.String fN,
                          boolean para,
                          boolean grid,
                          boolean merge,
                          double uoffx,
                          double uoffy,
                          boolean redraw)

loadDomainFEAST

public int loadDomainFEAST(java.lang.String fN)

scanLine

public void scanLine(java.lang.String t,
                     java.lang.String format,
                     double[] dret,
                     int[] iret,
                     java.lang.String[] sret)