public class GvrsMetadata extends Object implements Comparable<GvrsMetadata>
The syntax for the application-defined ID string (the "name") must conform to the rules for the GVRS identifier:
Note: GVRS identifiers are intended to be consistent with naming conventions across a broad range of computer languages (including C/C++, Java, C#, and Python). So the allowable character set for identifiers is limited.
The limit to metadata name lengths is 32 characters.
Modifier and Type | Field and Description |
---|---|
static int |
GVRS_METADATA_MAX_ID_LENGTH |
Constructor and Description |
---|
GvrsMetadata(String name,
GvrsMetadataType dataType)
Constructs a GVRS metadata instance with the specified data type,
but no restriction for record ID.
|
GvrsMetadata(String name,
int recordID,
GvrsMetadataType dataType)
Constructs a GVRS metadata instance with the specified parameters.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(GvrsMetadata o)
Implements a comparison based on name and recordID, in that order.
|
GvrsMetadataType |
getDataType()
Gets the metadata type associated with this instanced.
|
String |
getDescription()
Gets the description string stored with the metadata.
|
double |
getDouble() |
double[] |
getDoubles() |
int |
getInteger() |
int[] |
getIntegers() |
String |
getName()
Gets the application-defined "name" for the record.
|
int |
getRecordID()
Gets the application-defined numerical ID associated with the record.
|
short |
getShort() |
short[] |
getShorts() |
int |
getStorageSize()
Gets the amount of storage space required to store the metadata, in bytes.
|
String |
getString() |
int |
getUnsignedShort() |
int[] |
getUnsignedShorts() |
void |
setDescription(String description)
Sets an optional description string.
|
void |
setDouble(double value) |
void |
setDoubles(double[] values) |
void |
setInteger(int value) |
void |
setIntegers(int[] values) |
void |
setShort(short value) |
void |
setShorts(short[] values) |
void |
setString(String string) |
void |
setUnsignedShort(int value) |
void |
setUnsignedShorts(int[] values) |
void |
setUnsignedShorts(short[] values) |
String |
toString() |
public static final int GVRS_METADATA_MAX_ID_LENGTH
public GvrsMetadata(String name, int recordID, GvrsMetadataType dataType)
name
- an application-defined ID stringrecordID
- an application-defined numeric IDdataType
- the datatype for the metadata.public GvrsMetadata(String name, GvrsMetadataType dataType)
The syntax for the application-defined ID string (the "name") must conform to the rules for the GVRS identifier (see class notes above)
name
- an application-defined ID string conforming to the
rules for GVRS identifiers.dataType
- the datatype for the metadata.public void setDescription(String description)
description
- a valid string with an UTF-8 encoding.public GvrsMetadataType getDataType()
public String getDescription()
public int getStorageSize()
public void setInteger(int value)
public int getInteger()
public void setIntegers(int[] values)
public int[] getIntegers()
public void setShort(short value)
public short getShort()
public void setShorts(short[] values)
public short[] getShorts()
public void setDouble(double value)
public double getDouble()
public void setDoubles(double[] values)
public double[] getDoubles()
public void setString(String string)
public String getString()
public void setUnsignedShort(int value)
public int getUnsignedShort()
public void setUnsignedShorts(short[] values)
public void setUnsignedShorts(int[] values)
public int[] getUnsignedShorts()
public String getName()
public int getRecordID()
public int compareTo(GvrsMetadata o)
compareTo
in interface Comparable<GvrsMetadata>
o
- a valid instanceCopyright © 2022. All rights reserved.