jwo.landserf.process.io
Class TextVectorIO

java.lang.Object
  extended by jwo.landserf.process.io.FileIO
      extended by jwo.landserf.process.io.TextVectorIO

public class TextVectorIO
extends FileIO

Contains a collection of static methods for reading and writing text vector files.

Version:
2.3, 9th September, 2008.
Author:
Jo Wood

Field Summary
 
Fields inherited from class jwo.landserf.process.io.FileIO
BIG_ENDIAN, bitsPerValue, byteOrder, DEBUG, errorMessage, filePointer, GATHER_INFO, lineNumber, LITTLE_ENDIAN, LOAD_ALL, LOAD_SELECTED, nullCode, substituteNull, useMultiplier, zMultiplier
 
Constructor Summary
TextVectorIO()
          There should be no need to call the constructor explicitly since all methods are static.
 
Method Summary
static AttributeTable readAttributeTable(String fileName, LSThread lsThread)
          Reads the given attribute file and returns an attribute table with its contents.
static VectorMap readVector(String fileName, int fileFormat, GISFrame gisFrame, LSThread lsThread)
          Reads a text file in the given format and creates a vector map from it.
static boolean writeAttributeTable(AttributeTable attTable, String fileName, LSThread lsThread)
          Writes out the given attribute table to the given file.
static boolean writeVector(VectorMap vectorMap, String fileName, int fileFormat, GISFrame gisFrame, LSThread lsThread)
          Writes a text file in the given format based on the supplied vector map.
 
Methods inherited from class jwo.landserf.process.io.FileIO
debug, getErrorMessage, readByte, readByte, readCharacters, readCharacters, readCharactersInLine, readDouble, readDouble, readDoubleBigEndian, readDoubleBigEndian, readDoubleLittleEndian, readDoubleLittleEndian, readFloat, readFloat, readFloatBigEndian, readFloatBigEndian, readFloatLittleEndian, readFloatLittleEndian, readInt, readInt, readIntBigEndian, readIntBigEndian, readIntLittleEndian, readIntLittleEndian, readNextWord, readNextWord, readShort, readShort, readShortBigEndian, readShortBigEndian, readShortLittleEndian, readShortLittleEndian, readUnsignedByte, readUnsignedByte, reset, seek, skip, skip, writeByte, writeCharacters, writeDouble, writeDoubleBigEndian, writeDoubleLittleEndian, writeFloat, writeFloatBigEndian, writeFloatLittleEndian, writeInt, writeIntBigEndian, writeIntLittleEndian, writeLine, writeShort, writeShortBigEndian, writeShortLittleEndian
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextVectorIO

public TextVectorIO()
There should be no need to call the constructor explicitly since all methods are static.

Method Detail

readVector

public static VectorMap readVector(String fileName,
                                   int fileFormat,
                                   GISFrame gisFrame,
                                   LSThread lsThread)
Reads a text file in the given format and creates a vector map from it.

Parameters:
fileName - Name of file to read.
fileFormat - Type of text file to read (see FileHandler).
gisFrame - GUI in which to report results.
lsThread - Thread that called this method (allows it to be interrupted). Can be null, in which case, method cannot be interrupted.
Returns:
Vector map containing read data, or null if problems reading.
See Also:
FileHandler

writeVector

public static boolean writeVector(VectorMap vectorMap,
                                  String fileName,
                                  int fileFormat,
                                  GISFrame gisFrame,
                                  LSThread lsThread)
Writes a text file in the given format based on the supplied vector map.

Parameters:
vectorMap - Vector map to write.
fileName - Name of file to create.
fileFormat - Type of text file to create.
gisFrame - GUI in which to report progress.
lsThread - Thread that called this method (allows it to be interrupted). Can be null, in which case, method cannot be interrupted.
Returns:
True if written successfully.

readAttributeTable

public static AttributeTable readAttributeTable(String fileName,
                                                LSThread lsThread)
Reads the given attribute file and returns an attribute table with its contents. Returns null if problem reading attribute file. Lines starting with a # are ignored.

Parameters:
fileName - Name of attribute file to read.
lsThread - Thread that called this method (allows it to be interrupted). Can be null, in which case, method cannot be interrupted.
Returns:
Attribute table holding data or null if problems reading.

writeAttributeTable

public static boolean writeAttributeTable(AttributeTable attTable,
                                          String fileName,
                                          LSThread lsThread)
Writes out the given attribute table to the given file.

Parameters:
attTable - Attribute table to write.
fileName - Name of file to contain table.
lsThread - Thread that called this method (allows it to be interrupted). Can be null, in which case, method cannot be interrupted.
Returns:
true if written successfully.


Copyright Jo Wood, 1996-2009, last modified, 17th April, 2009