Class FileMincAttElem

All Implemented Interfaces:
Serializable, 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:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    DOCUMENT ME!
    int
    DOCUMENT ME!
    int
    DOCUMENT ME!
    private static final long
    Use serialVersionUID for interoperability.
    DOCUMENT ME!
  • Constructor Summary

    Constructors
    Constructor
    Description
    FileMincAttElem(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

    Modifier and Type
    Method
    Description
    Creates a new MincAttElem with the same parameters and values as this one.
    Returns the value stored in this minc attribute as a String.
    void
    setValue(Object value, int index)
    Sets the attribute's value array to the value at the indicated index.
    Method that converts this attribute to a readable string.

    Methods inherited from class gov.nih.mipav.model.structures.ModelSerialCloneable

    nativeClone

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • name

      public String name
      DOCUMENT ME!
    • nc_type

      public int nc_type
      DOCUMENT ME!
    • nelems

      public int nelems
      DOCUMENT ME!
    • values

      public Object[] values
      DOCUMENT ME!
  • Constructor Details

    • FileMincAttElem

      public FileMincAttElem(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 attribute
      nc_type - The type of this attribute, as in byte, char, etc.
      length - The length of the array holding the value of this attribute
  • Method Details

    • clone

      public Object clone()
      Creates a new MincAttElem with the same parameters and values as this one.
      Overrides:
      clone in class ModelSerialCloneable
      Returns:
      The new MincAttElem.
    • setValue

      public void setValue(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 String toString()
      Method that converts this attribute to a readable string. Used in displayAboutInfo for the image.
      Overrides:
      toString in class Object
      Returns:
      The string representation of this attribute.
    • getValueString

      public 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.