| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||
java.lang.Object
|
+--java.util.Dictionary
|
+--java.util.Hashtable
|
+--ncsa.horizon.util.Metadata
|
+--ncsa.horizon.coordinates.CoordMetadata
Coordinate-related classes in the Horizon package (e.g. CoordinateSystem, CoordPos, etc.) make use of specific set of metadata, the so-called horizon schema, which assumes specific types and meanings for them. This class provides special methods for setting values for these metadata in a way that ensures their proper type. Constructors provide sensible defaults for values not specifically set.
Below is a list of metadata that have specific meanings for coordinate systems and specific assumed types. Any that are not specified during construction are set to the default values shown.
Key Type Default Value
-------------------------------------------------------------
naxes Integer 1
name String --not set--
Axes Metavector Metadata object for each of
naxes axes; -see next table-
schema String "horizon"
schemaVersion String --release-specific--
-------------------------------------------------------------
Since this class is for the horizon schema, the schema and schemaVersion
would not normally need updating later. The Axes object is an array of Metadata objects, each containing sub-metadata that describes a particular axis. The Axes that have specified meanings and types are shown in the next table, along with values set for them by default:
Axes sub-metadata:
Key Type Default Value
-------------------------------------------------------------
axisSchema String "referenced"
name String "Pixels"
label String -not set-
type String "linear"
refposition Double 0.0
refvalue Double 0.0
stepsize Double 0.0
refoffset Double 0.0
formatter AxisPosFormatter GenericAxisPosFormatter
-------------------------------------------------------------
Note that the "axisSchema" metadatum is similar to "schema" in that it
indicates what metadata are used to parameterize the axis. A value
of "referenced" means that it is defined via a reference pixel using
the above metadata names. Thus, one would normally not need to update
the "axisSchema" metadatum. Each of these metadata listed in the first table may be set using a method called set<metadatum>(), where metadatum is the name of the metadatum (e.g. setName(String)). Sub-metadata for the "Axes" metadatum can be set directly using a method called setAxis<metadatum>() (e.g. setAxisRefvalue(int,double) For more information on what each of the above metadata represent, see its cooresponding set method.
| Field Summary | |
| static java.lang.String | Axes
|
| static java.lang.String | axisSchema
|
| static java.lang.String | formatter
|
| static java.lang.String | horizonSchema
|
| static java.lang.String | label
|
| static java.lang.String | name
|
| static java.lang.String | naxes
|
| static java.lang.String | refoffset
|
| static java.lang.String | refposition
|
| static java.lang.String | refvalue
|
| static java.lang.String | stepsize
|
| static java.lang.String | type
|
| static java.lang.String | version
version of horizon schema supported by this object |
| Fields inherited from class ncsa.horizon.util.Metadata | |
| defaults, executeRunners, METARUNNER_TAG, schema, schemaVersion | |
| Constructor Summary | |
| CoordMetadata()
Construct a CoordMetadata object with one axis with default values for the standard coordinate metadata |
|
| CoordMetadata(int naxes,
Metadata defaults)
Create a Metadata object describing a coordinate system with a given number of axes. |
|
| CoordMetadata(int naxes)
Creates an empty metadatum list with specified defaults. |
|
| CoordMetadata(Metadata defaults)
Creates an empty metadatum list with specified defaults. |
|
| CoordMetadata(boolean setDefaults)
|
|
| Method Summary | |
| static java.lang.Integer[] | axesMatchingName(Metadata in,
int toffset,
java.lang.String value,
int ooffset,
int len)
return the indices for axes in the input Metadata (as an array of Integers) whose names match a particular value. |
| static java.lang.Integer[] | axesMatchingName(Metadata in,
java.lang.String value,
int len)
same as Integer[] axesMatchingName(in, 0, value, 0, len) |
| static java.lang.Integer[] | axesMatchingType(Metadata in,
int toffset,
java.lang.String value,
int ooffset,
int len)
return the indices for axes in the input Metadata (as an array of Integers) whose types match a particular value. |
| static java.lang.Integer[] | axesMatchingType(Metadata in,
java.lang.String value,
int len)
same as Integer[] axesMatchingType(in, 0, value, 0, len) |
| static java.lang.Integer | axisExactlyMatchingName(Metadata in,
java.lang.String value)
return index for the axis in input Metadata with type exactly matching input value. |
| static java.lang.Integer | axisExactlyMatchingType(Metadata in,
java.lang.String value)
return index for the axis in input Metadata with type exactly matching input value. |
| static java.lang.Integer | firstAxisMatchingName(Metadata in,
int toffset,
java.lang.String value,
int ooffset,
int len)
return index for the first axis in the input Metadata with a type matching the input value. |
| static java.lang.Integer | firstAxisMatchingName(Metadata in,
java.lang.String value)
same as String firstAxisMatchingName(in, 0, value, 0, 0) |
| static java.lang.Integer | firstAxisMatchingType(Metadata in,
int toffset,
java.lang.String value,
int ooffset,
int len)
return index for the first axis in the input Metadata with a type matching the input value. |
| static java.lang.Integer | firstAxisMatchingType(Metadata in,
java.lang.String value)
same as String firstAxisMatchingType(in, 0, value, 0, 0) |
| static java.lang.String[] | getAxisNames(Metadata in)
extract the String array of axis names from the metadatum list (i.e. the "Axes[n].name" metadatum); null is returned if not found (or is of the wrong type). |
| static java.lang.String[] | getAxisStrings(java.lang.String mdname,
Metadata in)
|
| static java.lang.String[] | getAxisTypes(Metadata in)
extract the String array of axis types from the metadatum list (i.e. the "Axes[n].type" metadatum); null is returned if not found (or is of the wrong type). |
| static int | getNaxes(Metadata md)
return the current number of axes in the coordinate system described by the input Metadata |
| int | getNaxes()
return the current number of axes in the coordinate system |
| static java.lang.Integer[] | indicesMatchingString(java.lang.String[] s,
int toffset,
java.lang.String value,
int ooffset,
int len)
|
| void | initMetadata(int nax)
|
| java.lang.Object | put(java.lang.Object inkey,
java.lang.Object val)
update the value of a metadatum. |
| static void | setAxes(Metadata md,
Metavector axmv)
set the Axes object |
| void | setAxes(Metavector mv)
set the Axes object |
| static void | setAxisFormatter(Metadata md,
int axis,
AxisPosFormatter in)
set the axis formatter object for a specified axis. |
| static void | setAxisFormatter(Metadata md,
AxisPosFormatter[] in)
set the axis formatter objects for all axes. |
| void | setAxisFormatter(AxisPosFormatter[] in)
set the axis formatter objects for all axes. |
| void | setAxisFormatter(int axis,
AxisPosFormatter in)
set the axis formatter object for a specified axis. |
| static void | setAxisLabel(Metadata md,
int axis,
java.lang.String in)
set the axis label for the specified axis. |
| static void | setAxisLabel(Metadata md,
java.lang.String[] in)
set the axis labels which are usually used when printing out coordinate positions. |
| void | setAxisLabel(java.lang.String[] in)
set the axis labels which are usually used when printing out coordinate positions. |
| void | setAxisLabel(int axis,
java.lang.Object in)
set the axis label for the specified axis. |
| static void | setAxisName(Metadata md,
int axis,
java.lang.String in)
set the axis name for the specified axis. |
| void | setAxisName(java.lang.String[] in)
set the axis names. |
| static void | setAxisName(Metadata md,
java.lang.String[] in)
set the axis names. |
| void | setAxisName(int axis,
java.lang.String in)
set the axis name for the specified axis. |
| static void | setAxisObject(Metadata md,
int axis,
java.lang.String mdname,
java.lang.Object in)
set an Axes metadatum |
| void | setAxisRefoffset(int axis,
double in)
set the axis reference offset for the specified axis. |
| static void | setAxisRefoffset(Metadata md,
int axis,
double in)
set the axis reference offset for the specified axis. |
| static void | setAxisRefoffset(Metadata md,
double[] in)
set the axis reference offsets for all axes. |
| void | setAxisRefoffset(double[] in)
set the axis reference offsets for all axes. |
| static void | setAxisRefposition(Metadata md,
int axis,
double in)
set the axis reference position for the specified axis. |
| static void | setAxisRefposition(Metadata md,
double[] in)
set the axis reference position for all axes. |
| void | setAxisRefposition(double[] in)
set the axis reference position for all axes. |
| void | setAxisRefposition(int axis,
double in)
set the axis reference position for the specified axis. |
| static void | setAxisRefvalue(Metadata md,
int axis,
double in)
set the axis reference value for the specified axis. |
| static void | setAxisRefvalue(Metadata md,
double[] in)
set the axis reference values for all axes. |
| void | setAxisRefvalue(double[] in)
set the axis reference values for all axes. |
| void | setAxisRefvalue(int axis,
double in)
set the axis reference value for the specified axis. |
| static void | setAxisStepsize(Metadata md,
int axis,
double in)
set the axis step size for the specified axis. |
| static void | setAxisStepsize(Metadata md,
double[] in)
set the axis step size for all axes. |
| void | setAxisStepsize(double[] in)
set the axis step size for all axes. |
| void | setAxisStepsize(int axis,
double in)
set the axis step size for the specified axis. |
| static void | setAxisType(Metadata md,
int axis,
java.lang.String in)
set the axis type for the specified axis. |
| static void | setAxisType(Metadata md,
java.lang.String[] in)
set the axis types. |
| void | setAxisType(java.lang.String[] in)
set the axis types. |
| void | setAxisType(int axis,
java.lang.String in)
set the axis type for the specified axis. |
| static void | setName(Metadata md,
java.lang.String in)
set the name of the coordinate system |
| void | setName(java.lang.String in)
set the name of the coordinate system |
| static void | setNaxes(Metadata md,
int nax)
set the number of axes in the coordinate system |
| void | setNaxes(int nax)
set the number of axes in the coordinate system |
| static boolean | usesHorizonSchema(Metadata in)
returns true if Metadata claims to use the "horizon" schema |
| static boolean | usesReferencedAxis(Metadata in,
int axis)
returns true if Metadata claims to use the "horizon" schema |
| Methods inherited from class ncsa.horizon.util.Metadata | |
| cloneDefaults, clone, copyMetadata, copyMetadata, deepClone, detachedClone, detach, fetchDatum, fetchMetadatum, getDefaults, getMetadatum, getMetadatum, getMetadatum, getMetadatum, getRunnerNames, giveDefaults, metadatumNames, put, removeAllMetadata, setDefaults, setSchema, setSchemaVersion, toString | |
| Methods inherited from class java.util.Hashtable | |
| clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keySet, keys, putAll, put, rehash, remove, size, toString, values | |
| Methods inherited from class java.util.Dictionary | |
| elements, get, isEmpty, keys, put, remove, size | |
| Methods inherited from class java.lang.Object | |
| clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait | |
| Field Detail |
public static final java.lang.String horizonSchema
public static final java.lang.String version
public static final java.lang.String Axes
public static final java.lang.String naxes
public static final java.lang.String name
public static final java.lang.String axisSchema
public static final java.lang.String type
public static final java.lang.String label
public static final java.lang.String formatter
public static final java.lang.String refposition
public static final java.lang.String refvalue
public static final java.lang.String stepsize
public static final java.lang.String refoffset
| Constructor Detail |
public CoordMetadata()
public CoordMetadata(int naxes,
Metadata defaults)
throws java.lang.ArrayIndexOutOfBoundsException
naxes
- the number of axes in the coordinate system
defaults
- the defaults (can be null)
public CoordMetadata(int naxes)
throws java.lang.ArrayIndexOutOfBoundsException
naxes
- the number of axes in this coordinate system
public CoordMetadata(Metadata defaults)
throws java.lang.ArrayIndexOutOfBoundsException
defaults
- the defaultsprotected CoordMetadata(boolean setDefaults)
| Method Detail |
protected void initMetadata(int nax)
public static int getNaxes(Metadata md)
public int getNaxes()
public static void setNaxes(Metadata md,
int nax)
throws java.lang.ArrayIndexOutOfBoundsException
public void setNaxes(int nax)
throws java.lang.ArrayIndexOutOfBoundsException
public static void setName(Metadata md,
java.lang.String in)
public void setName(java.lang.String in)
protected static void setAxes(Metadata md,
Metavector axmv)
protected void setAxes(Metavector mv)
protected static void setAxisObject(Metadata md,
int axis,
java.lang.String mdname,
java.lang.Object in)
axis
- the index of the axis to be set (first axis has index 0)
mdname
- name of metadatum to be updated
in
- Object to be set
public static void setAxisLabel(Metadata md,
int axis,
java.lang.String in)
axis
- the index of the axis to be set (first axis has index 0)
in
- String to be used as a label
public static void setAxisLabel(Metadata md,
java.lang.String[] in)
in
- array of Strings to be used as labelspublic void setAxisLabel(java.lang.String[] in)
in
- array of Strings to be used as labels
public void setAxisLabel(int axis,
java.lang.Object in)
axis
- the index of the axis to be set (first axis has index 0)
in
- String to be used as a label
public static void setAxisName(Metadata md,
int axis,
java.lang.String in)
axis
- the index of the axis to be set (first axis has index 0)
in
- array of Strings to be used as namespublic void setAxisName(java.lang.String[] in)
in
- array of Strings to be used as names
public static void setAxisName(Metadata md,
java.lang.String[] in)
in
- String to be used as a name
public void setAxisName(int axis,
java.lang.String in)
axis
- the index of the axis to be set (first axis has index 0)
in
- String to be used as a name
public static void setAxisType(Metadata md,
int axis,
java.lang.String in)
axis
- the index of the axis to be set (first axis has index 0)
in
- String to be used as a name
public static void setAxisType(Metadata md,
java.lang.String[] in)
in
- String to be used as a namepublic void setAxisType(java.lang.String[] in)
in
- String to be used as a name
public void setAxisType(int axis,
java.lang.String in)
axis
- the index of the axis to be set (first axis has index 0)
in
- String to be used as a name
public static void setAxisRefvalue(Metadata md,
int axis,
double in)
axis
- the index of the axis to be set (first axis has index 0)
in
- value to be set
public static void setAxisRefvalue(Metadata md,
double[] in)
in
- values to be setpublic void setAxisRefvalue(double[] in)
in
- values to be set
public void setAxisRefvalue(int axis,
double in)
axis
- the index of the axis to be set (first axis has index 0)
in
- value to be set
public static void setAxisRefposition(Metadata md,
int axis,
double in)
axis
- the index of the axis to be set (first axis has index 0)
in
- value to be set
public static void setAxisRefposition(Metadata md,
double[] in)
in
- values to be setpublic void setAxisRefposition(double[] in)
in
- values to be set
public void setAxisRefposition(int axis,
double in)
axis
- the index of the axis to be set (first axis has index 0)
in
- value to be set
public static void setAxisStepsize(Metadata md,
int axis,
double in)
axis
- the index of the axis to be set (first axis has index 0)
in
- value to be set
public static void setAxisStepsize(Metadata md,
double[] in)
axis
- the index of the axis to be set (first axis has index 0)
in
- values to be setpublic void setAxisStepsize(double[] in)
in
- values to be set
public void setAxisStepsize(int axis,
double in)
axis
- the index of the axis to be set (first axis has index 0)
in
- value to be set
public void setAxisRefoffset(int axis,
double in)
axis
- the index of the axis to be set (first axis has index 0)
in
- value to be set
public static void setAxisRefoffset(Metadata md,
int axis,
double in)
axis
- the index of the axis to be set (first axis has index 0)
in
- value to be set
public static void setAxisRefoffset(Metadata md,
double[] in)
in
- value to be setpublic void setAxisRefoffset(double[] in)
in
- value to be set
public static void setAxisFormatter(Metadata md,
int axis,
AxisPosFormatter in)
md
- the metadata to operate on
axis
- the index of the axis to be set (first axis has index 0)
in
- the formatter object to be set
public static void setAxisFormatter(Metadata md,
AxisPosFormatter[] in)
md
- the metadata to operate on
in
- the formatter objects to be setpublic void setAxisFormatter(AxisPosFormatter[] in)
in
- the formatter objects to be set
public void setAxisFormatter(int axis,
AxisPosFormatter in)
public java.lang.Object put(java.lang.Object inkey,
java.lang.Object val)
inkey
- the key name (should be of type String)
val
- the value to set for the metadatum with key namepublic static java.lang.String[] getAxisNames(Metadata in)
public static java.lang.String[] getAxisTypes(Metadata in)
protected static java.lang.String[] getAxisStrings(java.lang.String mdname,
Metadata in)
protected static java.lang.Integer[] indicesMatchingString(java.lang.String[] s,
int toffset,
java.lang.String value,
int ooffset,
int len)
public static java.lang.Integer[] axesMatchingType(Metadata in,
int toffset,
java.lang.String value,
int ooffset,
int len)
in
- input Metadata list to search
toffset
- begin search of Metadatum value at position toffset
value
- metadatum value to compare to
ooffset
- compare to substring of value starting at position
ooffset
len
- use first len characters in comparison. If len=0,
compare first value.length() characters; if len<0,
look for an exact match (of substrings using toffset
and ooffset).
public static java.lang.Integer[] axesMatchingType(Metadata in,
java.lang.String value,
int len)
public static java.lang.Integer axisExactlyMatchingType(Metadata in,
java.lang.String value)
(axisMatchingType(in, 0, value, 0, -1))[0]
(assuming AxisMatchingType did not return null).
public static java.lang.Integer firstAxisMatchingType(Metadata in,
int toffset,
java.lang.String value,
int ooffset,
int len)
in
- input Metadata list to search
toffset
- begin search of Metadatum value at position toffset
value
- metadatum value to compare to
ooffset
- compare to substring of value starting at position
ooffset
len
- use first len characters in comparison. If len=0,
compare first value.length() characters; if len<0,
look for an exact match (of substrings using toffset
and ooffset).
public static java.lang.Integer firstAxisMatchingType(Metadata in,
java.lang.String value)
public static java.lang.Integer[] axesMatchingName(Metadata in,
int toffset,
java.lang.String value,
int ooffset,
int len)
in
- input Metadata list to search
toffset
- begin search of Metadatum value at position toffset
value
- metadatum value to compare to
ooffset
- compare to substring of value starting at position
ooffset
len
- use first len characters in comparison. If len=0,
compare first value.length() characters; if len<0,
look for an exact match (of substrings using toffset
and ooffset).
public static java.lang.Integer[] axesMatchingName(Metadata in,
java.lang.String value,
int len)
public static java.lang.Integer axisExactlyMatchingName(Metadata in,
java.lang.String value)
(AxisMatchingName(in, 0, value, 0, -1))[0]
(assuming AxisMatchingName did not return null).
public static java.lang.Integer firstAxisMatchingName(Metadata in,
int toffset,
java.lang.String value,
int ooffset,
int len)
in
- input Metadata list to search
toffset
- begin search of Metadatum value at position toffset
value
- metadatum value to compare to
ooffset
- compare to substring of value starting at position
ooffset
len
- use first len characters in comparison. If len=0,
compare first value.length() characters; if len<0,
look for an exact match (of substrings using toffset
and ooffset).
public static java.lang.Integer firstAxisMatchingName(Metadata in,
java.lang.String value)
public static boolean usesHorizonSchema(Metadata in)
public static boolean usesReferencedAxis(Metadata in,
int axis)
| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||