public class DatatypeString extends DicomValue
| Modifier and Type | Method and Description |
|---|---|
void |
dumpDICOMInfo(IDicomStream objIDicomStream)
Dumps the value of Data Type String in readable form to the specified Stream.
|
long |
getMaxLength()
Retrieves maximum allowed length by this datatype.
|
int |
getValueLength()
Retrieves the actual value length set in the DataTypeString.
|
boolean |
read(IDicomStream objIDicomStream,
int iLength)
Reads and validates the data value from the stream of specified length of bytes.
|
void |
setValue(java.lang.Object objValue)
Sets the value in the DicomValue after performing validation on the value.
|
java.lang.String |
toString()
This function returns the String value of Data Type String.
|
boolean |
validate()
Validates the data value object as per the encoding rules provided in the DICOM Standard.
|
boolean |
validate(java.lang.Object objToValidate)
Validates the data value object as per the encoding rules provided in the DICOM Standard.
|
int |
validateLength(int iLengthToValidate)
This method checks for the length of string read from stream to be less or equal to max allowed length by the datatype of the value.
|
int |
write(IDicomStream objIDicomStream)
This method writes the Data Value to the given Stream.
|
clone, getIVRType, getValue, getValueMultiplicity, setIVRTypepublic long getMaxLength()
public boolean read(IDicomStream objIDicomStream, int iLength) throws InvalidDataTypeException, java.io.IOException
read in interface IDicomValueread in class DicomValueobjIDicomStream - isntance of class implementing the IDicomStream interface.iLength - Number of bytes to be read from the Stream.InvalidDataTypeException - If DataType validation fails.java.io.IOException - If Input/Output operation fails.public int validateLength(int iLengthToValidate)
throws LengthLimitException
iLengthToValidate - length of the value to be validated.LengthLimitException - If length exceeds from allowed length.public boolean validate(java.lang.Object objToValidate)
throws ValidationException
validate in interface IDicomValuevalidate in class DicomValueobjToValidate - object representing value to be validated.ValidationException - If validation fails according to Dicom rules.public boolean validate()
throws ValidationException
validate in interface IDicomValuevalidate in class DicomValueValidationException - If validation fails according to Dicom rules.public int write(IDicomStream objIDicomStream) throws java.io.IOException
write in interface IDicomValuewrite in class DicomValueobjIDicomStream - object of the stream onto which the DataTypeString is to be written.java.io.IOException - If Input/Output operation fails.public int getValueLength()
getValueLength in interface IDicomValuegetValueLength in class DicomValuepublic void setValue(java.lang.Object objValue)
throws InvalidDataTypeException
setValue in interface IDicomValuesetValue in class DicomValueobjValue - value that is to be set into the DicomValueInvalidDataTypeException - If DataType validation fails.public java.lang.String toString()
toString in class java.lang.Objectpublic void dumpDICOMInfo(IDicomStream objIDicomStream) throws java.io.IOException
objIDicomStream - - the Stream on which the Data is to be written.java.io.IOException - - Exception is thrown indicating runtime failure of writing operation.