Package gov.nih.mipav.model.file
Class FileMincAttElem
- java.lang.Object
-
- gov.nih.mipav.model.structures.ModelSerialCloneable
-
- gov.nih.mipav.model.file.FileMincAttElem
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class FileMincAttElem extends ModelSerialCloneable
This class represents a MINC atrribute element. Atrribute elements consist of a name, a type (as in byte, char, etc), a number of elements, and an array of values. Often, the type is char and thus the array is an array of chars - or a string. Another example is name="valid_range", type=double, nelems=2, and array[0] = 0.0, array[1] = 4095.0.- Author:
- Neva Cherniavsky
- See Also:
FileInfoMinc
,FileMinc
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
name
DOCUMENT ME!int
nc_type
DOCUMENT ME!int
nelems
DOCUMENT ME!private static long
serialVersionUID
Use serialVersionUID for interoperability.java.lang.Object[]
values
DOCUMENT ME!
-
Constructor Summary
Constructors Constructor Description FileMincAttElem(java.lang.String name, int nc_type, int length)
Constructor that creates the attribute element and initializes the array to the type of the parameter and the length of the parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
Creates a new MincAttElem with the same parameters and values as this one.java.lang.String
getValueString()
Returns the value stored in this minc attribute as a String.void
setValue(java.lang.Object value, int index)
Sets the attribute's value array to the value at the indicated index.java.lang.String
toString()
Method that converts this attribute to a readable string.-
Methods inherited from class gov.nih.mipav.model.structures.ModelSerialCloneable
nativeClone
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
name
public java.lang.String name
DOCUMENT ME!
-
nc_type
public int nc_type
DOCUMENT ME!
-
nelems
public int nelems
DOCUMENT ME!
-
values
public java.lang.Object[] values
DOCUMENT ME!
-
-
Constructor Detail
-
FileMincAttElem
public FileMincAttElem(java.lang.String name, int nc_type, int length)
Constructor that creates the attribute element and initializes the array to the type of the parameter and the length of the parameter.- Parameters:
name
- The name of this attributenc_type
- The type of this attribute, as in byte, char, etc.length
- The length of the array holding the value of this attribute
-
-
Method Detail
-
clone
public java.lang.Object clone()
Creates a new MincAttElem with the same parameters and values as this one.- Overrides:
clone
in classModelSerialCloneable
- Returns:
- The new MincAttElem.
-
setValue
public void setValue(java.lang.Object value, int index)
Sets the attribute's value array to the value at the indicated index.- Parameters:
value
- Value to set.index
- Place in the array to put the value.
-
toString
public java.lang.String toString()
Method that converts this attribute to a readable string. Used in displayAboutInfo for the image.- Overrides:
toString
in classjava.lang.Object
- Returns:
- The string representation of this attribute.
-
getValueString
public java.lang.String getValueString()
Returns the value stored in this minc attribute as a String.- Returns:
- The values in the attribute, nc_char values are joined together, all other types are separated by spaces.
-
-