Package jline.lang

Class ModelAttribute

java.lang.Object
jline.lang.ModelAttribute
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
NetworkAttribute

public class ModelAttribute extends Object implements Serializable
Metadata container held by every Model, twin of the untyped attribute struct of matlab/src/lang/Model.m. MATLAB stores model metadata as dynamically-named struct fields, so the Java twin is a string-keyed map. Subclasses needing a typed container extend this one (NetworkAttribute does), which keeps the covariant getAttribute() override on Network legal.
See Also:
  • Constructor Details

    • ModelAttribute

      public ModelAttribute()
  • Method Details

    • get

      public Object get(String key)
      Reads a metadata field.
      Parameters:
      key - the field name
      Returns:
      the stored value, or null when the field is unset
    • put

      public void put(String key, Object value)
      Writes a metadata field, overwriting any previous value.
      Parameters:
      key - the field name
      value - the value to store
    • has

      public boolean has(String key)
      Tests whether a metadata field is set.
      Parameters:
      key - the field name
      Returns:
      true if the field is present
    • remove

      public Object remove(String key)
      Removes a metadata field.
      Parameters:
      key - the field name
      Returns:
      the removed value, or null when the field was unset
    • keys

      public Set<String> keys()
      Lists the metadata fields currently set, in insertion order.
      Returns:
      the field names
    • clear

      public void clear()
      Removes every metadata field.