Package jline.lang
Class ModelAttribute
java.lang.Object
jline.lang.ModelAttribute
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
NetworkAttribute
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes every metadata field.Reads a metadata field.booleanTests whether a metadata field is set.keys()Lists the metadata fields currently set, in insertion order.voidWrites a metadata field, overwriting any previous value.Removes a metadata field.
-
Constructor Details
-
ModelAttribute
public ModelAttribute()
-
-
Method Details
-
get
Reads a metadata field.- Parameters:
key- the field name- Returns:
- the stored value, or null when the field is unset
-
put
Writes a metadata field, overwriting any previous value.- Parameters:
key- the field namevalue- the value to store
-
has
Tests whether a metadata field is set.- Parameters:
key- the field name- Returns:
- true if the field is present
-
remove
Removes a metadata field.- Parameters:
key- the field name- Returns:
- the removed value, or null when the field was unset
-
keys
Lists the metadata fields currently set, in insertion order.- Returns:
- the field names
-
clear
public void clear()Removes every metadata field.
-