public class HeaderInfo extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BANDFILES |
static String |
BANDNAMES |
static String |
BIGENDIAN |
static String |
BYTEORDER |
static String |
DATATYPE |
static String |
DESCRIPTION |
static String |
ELEMENTS |
private String |
headerFile
Path to header file.
|
static String |
INTERLEAVE |
static int |
kFormat1ByteUInt |
static int |
kFormat2ByteSInt |
static int |
kFormat2ByteUInt |
static int |
kFormat2x8Byte |
static int |
kFormat4ByteFloat |
static int |
kFormat4ByteSInt |
static int |
kFormat8ByteDouble |
static int |
kFormatASCII |
static int |
kFormatImage |
static int |
kFormatUnknown |
static String |
kInterleaveByLine |
static String |
kInterleaveByPixel |
static String |
kInterleaveSequential |
static int |
kNavigationBounds |
static int |
kNavigationFiles |
static int |
kNavigationUnknown |
static String |
LINES |
static String |
MISSINGVALUE |
static String |
NAVBOUNDS |
static String |
NAVFILES |
static String |
OFFSET |
private Hashtable |
parameters
Map containing relevant parameters and values in
headerFile . |
static String |
UNIT |
Constructor and Description |
---|
HeaderInfo()
Ctor for xml encoding
|
HeaderInfo(File thisFile)
CTOR
|
HeaderInfo(String filename)
CTOR
|
Modifier and Type | Method and Description |
---|---|
boolean |
doesExist()
Does the file we are pointing to even exist?
|
int |
getBandCount()
Get the current header's band count.
|
String |
getFilename()
Get the file being used.
|
Boolean |
getParameter(String parameter,
Boolean defaultValue)
Return
Boolean value associated with parameter . |
Float |
getParameter(String parameter,
Float defaultValue)
Return
Float value associated with parameter . |
Integer |
getParameter(String parameter,
Integer defaultValue)
Return
Integer value associated with parameter . |
List |
getParameter(String parameter,
List defaultValue)
Return
List associated with parameter . |
String |
getParameter(String parameter,
String defaultValue)
Return
String value associated with parameter . |
boolean |
haveParsed()
Have we already parsed once?
|
protected void |
parseHeader()
Override this when extending for a specific header type
|
void |
setFilename(String filename)
Set the file name to be used.
|
void |
setParameter(String parameter,
Object value)
Set a parsed parameter value.
|
public static final int kFormatUnknown
public static final int kFormatASCII
public static final int kFormat1ByteUInt
public static final int kFormat2ByteSInt
public static final int kFormat4ByteSInt
public static final int kFormat4ByteFloat
public static final int kFormat8ByteDouble
public static final int kFormat2x8Byte
public static final int kFormat2ByteUInt
public static final int kFormatImage
public static final int kNavigationUnknown
public static final int kNavigationBounds
public static final int kNavigationFiles
public static final String kInterleaveSequential
public static final String kInterleaveByLine
public static final String kInterleaveByPixel
public static final String DESCRIPTION
public static final String ELEMENTS
public static final String LINES
public static final String UNIT
public static final String OFFSET
public static final String DATATYPE
public static final String MISSINGVALUE
public static final String BANDNAMES
public static final String BANDFILES
public static final String INTERLEAVE
public static final String BYTEORDER
public static final String BIGENDIAN
public static final String NAVBOUNDS
public static final String NAVFILES
private String headerFile
private Hashtable parameters
headerFile
.public HeaderInfo()
public HeaderInfo(File thisFile)
thisFile
- File to use. Cannot be null
.public HeaderInfo(String filename)
filename
- File containing header information.public void setFilename(String filename)
filename
- File containing header information.public String getFilename()
public int getBandCount()
public String getParameter(String parameter, String defaultValue)
String
value associated with parameter
.parameter
- Parameter name.defaultValue
- Value to return if parameter
does not exist.List
associated with parameter
, or
defaultValue
.public Integer getParameter(String parameter, Integer defaultValue)
Integer
value associated with parameter
.parameter
- Parameter name.defaultValue
- Value to return if parameter
does not exist.Integer
associated with parameter
, or
defaultValue
.public Float getParameter(String parameter, Float defaultValue)
Float
value associated with parameter
.parameter
- Parameter name.defaultValue
- Value to return if parameter
does not exist.Float
associated with parameter
, or
defaultValue
.public Boolean getParameter(String parameter, Boolean defaultValue)
Boolean
value associated with parameter
.parameter
- Parameter name.defaultValue
- Value to return if parameter
does not exist.Boolean
associated with parameter
, or
defaultValue
.public List getParameter(String parameter, List defaultValue)
List
associated with parameter
.parameter
- Parameter name.defaultValue
- Value to return if parameter
does not exist.List
associated with parameter
, or
defaultValue
.public void setParameter(String parameter, Object value)
parameter
- Parameter name.value
- Value associated with parameter
.public boolean haveParsed()
true
if parameters
has at least entry.public boolean doesExist()
headerFile
exists.protected void parseHeader()