faa.tg.prep.aces.geomaps
Class GeoMapHeader

java.lang.Object
  extended by faa.tg.prep.aces.geomaps.DcpWord
      extended by faa.tg.prep.aces.geomaps.GeoMapHeader

public class GeoMapHeader
extends DcpWord

 GeoMapHeader contains the map-length (in bytes), the map name, and
 an integer representing how many bytes to skip until
 other DcpWords are received.
 
See the source GeoMapHeader.java

Version:
$Id: GeoMapHeader.java,v 3.1 2006/03/14 15:57:30 samf Exp $
Author:
Timothy Swantek

Field Summary
private  int bytesToSkip
           
static java.lang.String CVS_VERSION_ID
          The CVS Version ID
private  java.io.DataInputStream dis
           
private static int EBASE
           
private static java.lang.String EBCDIC
           
private  int mapLength
           
private  java.lang.String mapName
           
private  int tempChar
           
private  int[] word
           
private static int WORD_LENGTH
           
private static int WORDS_IN_NAME_LENGTH
           
private  Distance xCenterCoord
           
private  Distance yCenterCoord
           
 
Fields inherited from class faa.tg.prep.aces.geomaps.DcpWord
ID, MAX_LINEVALUE, MAX_SYMBOLVALUE, MIN_LINEVALUE, MIN_SYMBOLVALUE
 
Constructor Summary
GeoMapHeader(java.io.BufferedInputStream bis)
          Constructor - Construct a new GeoMapHeader from the BufferedInputStream.
 
Method Summary
 int getBytesConsumed()
          Method getBytesConsumed
 int getMapLength()
          Method getMapLength returns the mapLength field of this object.
 java.lang.String getMapName()
          Method getMapName is an accessor to the mapName field of this object.
private  void getToDcpWords()
          getToDcpWords moves the position in the BufferdInputStream to the location of the first DcpWord.
 Distance getXCoord()
          Method getXCoord
 Distance getYCoord()
          Method getYCoord
private  void setCoords()
          Method setCoords() Sets the xCoord and yCoord relating to the geomap center coords.
private  void setMapLength()
          The first 2 bytes in every map contain the length of that map in bytes.
private  void setMapName()
          After the MapLength is retrieved we have the map name in ebcdic form.
 
Methods inherited from class faa.tg.prep.aces.geomaps.DcpWord
alignmentWordCheck, getClassTypeNumber, getDIS, getFirstHalf, getSecondHalf, getWord, nextWord
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CVS_VERSION_ID

public static final java.lang.String CVS_VERSION_ID
The CVS Version ID

See Also:
Constant Field Values

EBCDIC

private static final java.lang.String EBCDIC
See Also:
Constant Field Values

EBASE

private static final int EBASE
See Also:
Constant Field Values

WORDS_IN_NAME_LENGTH

private static final int WORDS_IN_NAME_LENGTH
See Also:
Constant Field Values

WORD_LENGTH

private static final int WORD_LENGTH
See Also:
Constant Field Values

word

private int[] word

dis

private java.io.DataInputStream dis

mapName

private java.lang.String mapName

bytesToSkip

private int bytesToSkip

mapLength

private int mapLength

tempChar

private int tempChar

xCenterCoord

private Distance xCenterCoord

yCenterCoord

private Distance yCenterCoord
Constructor Detail

GeoMapHeader

public GeoMapHeader(java.io.BufferedInputStream bis)
             throws java.io.EOFException,
                    java.io.IOException
Constructor - Construct a new GeoMapHeader from the BufferedInputStream.

Parameters:
bis - is the BufferedInputStream to read the bytes from.
Throws:
java.io.EOFException
java.io.IOException
Method Detail

setMapLength

private void setMapLength()
                   throws java.io.EOFException
The first 2 bytes in every map contain the length of that map in bytes. The second two contain a dummy value which we can ignore.

Throws:
java.io.EOFException

setMapName

private void setMapName()
                 throws java.io.EOFException,
                        java.lang.StringIndexOutOfBoundsException
After the MapLength is retrieved we have the map name in ebcdic form. Using a simple calculation we change it to ascii. Note that blank characters can make up the name in two forms: if the value is indicated in the EBCDIC string, or if the byte read is equal to 0x40 (64))

Throws:
java.io.EOFException
java.lang.StringIndexOutOfBoundsException

getToDcpWords

private void getToDcpWords()
                    throws java.io.EOFException
getToDcpWords moves the position in the BufferdInputStream to the location of the first DcpWord. This is based on the disps which normally occur within the data. A 'disp' is a displacement from an AcesClassType to the beginning of it's specific data . These disps have been left out of our Xml conversions, but still exist within the Aces Geomaps file. A more complete account can be found in the Readme.doc associated with this package. Note that we also set the mapLength from this position, but were unable to do so earlier as bytesToSkip was never given a value to subtract. NOTE: Tampering with this method is not recommended. The current location we end at contains the center coords for this map. This value is also ignored in the factory, but could be easily moved here.

Throws:
java.io.EOFException

setCoords

private void setCoords()
Method setCoords() Sets the xCoord and yCoord relating to the geomap center coords.


getMapName

public final java.lang.String getMapName()
Method getMapName is an accessor to the mapName field of this object. The String returned is Trimmed of blank space.

Returns:
mapName : The name of the current Acesgeomap.

getMapLength

public final int getMapLength()
Method getMapLength returns the mapLength field of this object.

Returns:
mapLength : The length of the map given in the number of bytes contained within it.

getBytesConsumed

public final int getBytesConsumed()
Method getBytesConsumed

Specified by:
getBytesConsumed in class DcpWord
Returns:
bytesToSkip : Our position within the Acesgeomap.

getXCoord

public final Distance getXCoord()
Method getXCoord

Returns:
xCenterCoord : The xCoord regarding the maps center.

getYCoord

public final Distance getYCoord()
Method getYCoord

Returns:
yCenterCoord : The yCoord regarding the maps center.