Class OctaveStruct

  • All Implemented Interfaces:
    OctaveObject

    public final class OctaveStruct
    extends Object
    implements OctaveObject
    1x1 struct. JavaOctave does not support the multidimensional structs that octave has.
    • Constructor Detail

      • OctaveStruct

        public OctaveStruct()
        Create empty struct.
      • OctaveStruct

        public OctaveStruct​(Map<String,​OctaveObject> data)
        Create struct from data.
        Parameters:
        data - this data will be referenced, not copied
    • Method Detail

      • get

        public OctaveObject get​(String key)
        Get object from struct as plain OctaveObject. If you want to cast the object to a special type use get(Class, String).
        Parameters:
        key -
        Returns:
        shallow copy of value for this key, or null if key isn't there.
      • get

        public <T extends OctaveObject> T get​(Class<T> castClass,
                                              String key)
        Type Parameters:
        T -
        Parameters:
        castClass - Class to cast to
        key -
        Returns:
        shallow copy of value for this key, or null if key isn't there.
        Throws:
        OctaveClassCastException - if the object can not be cast to a castClass
      • shallowCopy

        public OctaveStruct shallowCopy()
        Description copied from interface: OctaveObject
        Make a shallow copy of this object. In general when an OctaveObject is returned from a getter, e.g. on OctaveStruct or OctaveStruct, a shallow copy is returned in order to follow the way octave behaves. This method is used to make that copy.
        Specified by:
        shallowCopy in interface OctaveObject
        Returns:
        a shallow copy of this
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object