public class Variable extends Object
Constructor and Description |
---|
Variable() |
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(Attribute attribute)
Add a predefined attribute to the list of attributes.
|
ArrayList<String> |
addDataSamples(ArrayList<String> values)
Get data value at given index
|
void |
dump()
Display a description of each variable.
|
long |
getArraySize()
Get Array size
The array size is the product of number of records and all array dimensions.
|
long |
getArraySizeInBytes()
Get Record size in bytes
The record size is the of all array dimensions.
|
Attribute |
getAttribute(String name)
Retrieve the description of a global attribute with the given name.
|
ArrayList<Attribute> |
getAttributes()
Retrieve all attributes associated with the variable.
|
String |
getAttributeValue(String name)
Retrieve an attribute with a given name.
|
String |
getAttributeValue(String name,
String delim)
Retrieve an attribute with a given name.
|
String |
getDataSample(int n)
Get the data value at given index
|
ArrayList<String> |
getDataSamples()
Retrieve the data samples of the variable.
|
int |
getDataType()
Retrieve the data type of the variable.
|
int |
getDim(int n)
Retrieve the value of a specified dimension of the variable.
|
int |
getDimCount()
Retrieve the dimensions of the variable.
|
int[] |
getDims()
Retrieve the dimensions of the variable.
|
int |
getFlags()
Retrieve the flags associated with the variable.
|
int |
getIndex()
Retrieve the index of the variable.
|
String |
getName()
Retrieve the name of the variable.
|
long |
getRecordCount()
Retrieve the number of data records in the varaible.
|
long |
getRecordSize()
Get Record size
The record size is the of all array dimensions.
|
long |
getRecordSizeInBytes()
Get Record size in bytes
The record size is the of all array dimensions.
|
long |
getStartByte()
Retrieve the start byte of the data associated with the variable.
|
void |
readDataSampleValues(RandomAccessFile in,
int start,
int stop) |
void |
setAttribute(String name,
ArrayList<String> values)
Define an attribute and the values associated with the attribute.
|
String |
setAttributeValue(String name,
String value)
Set the value of a global attribute with the given name.
|
void |
setDataType(int dataType)
Set the data type for the variable.
|
int[] |
setDims(int[] dims)
Set the number and size of data dimensions.
|
void |
setFlags(int flags)
Set the flag values for the variable.
|
void |
setIndex(int index)
Set the index of the variable.
|
void |
setName(String name)
Set the name for the variable.
|
double[] |
setPadValue(double[] padValue)
Set the pad values for each dimension of a variable.
|
void |
setRecordCount(long recordCount)
Set the number of data records in the variable.
|
void |
setStartByte(long startByte)
Set the start byte of the data associated with the variable.
|
public void readDataSampleValues(RandomAccessFile in, int start, int stop) throws IOException
IOException
public void dump()
public ArrayList<String> addDataSamples(ArrayList<String> values)
index
- the absolute index into a serialized array.public String getDataSample(int n)
index
- the index into a serialized array.public long getArraySize()
public long getArraySizeInBytes()
public long getRecordSize()
public long getRecordSizeInBytes()
public void setName(String name)
name
- the name for the variable.public String getName()
public void setDataType(int dataType)
dataType
- the data type for the variable.public ArrayList<String> getDataSamples()
public int getDataType()
public void setFlags(int flags)
flags
- the current flag values for the variable.public int getFlags()
public void setIndex(int index)
index
- the index of the variable.public int getIndex()
public void setStartByte(long startByte)
startByte
- the start byte of the data associated with the variable.public long getStartByte()
public void setRecordCount(long recordCount)
recordCount
- the number of data records in the variable.public long getRecordCount()
public int[] setDims(int[] dims)
dims
- an array defining the dimensions.public int[] getDims()
public int getDim(int n)
public int getDimCount()
public double[] setPadValue(double[] padValue)
padValue
- an array of pad values.public void addAttribute(Attribute attribute)
attribute
- the predefined Attribute.public Attribute getAttribute(String name)
name
- the name of the attributeAttribute
with the matching name or NULL if none found.public void setAttribute(String name, ArrayList<String> values)
name
- the name of the attribute.values
- the array of values to associate with the attribute.public String getAttributeValue(String name)
name
- the name of the attribute.public String getAttributeValue(String name, String delim)
name
- the name of the attribute.delim
- the delimiter to place between values.public String setAttributeValue(String name, String value)
name
- the name of the attributevalue
- the value to set.Copyright © 2014-2015 Regents University of California. All Rights Reserved.