Interface Memento
-
public interface Memento
Serves as a storage abstraction to persist configuration information for model roots or other elements between sessions in a generic way. Mementos, in essence, resemble hierarchically organized hashmaps. The actual contents of the mementos and the shape of the hierarchy are a responsibility of the owning ModelRoot.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Memento
copy()
Returns a deep copy of the current memento and its childrenMemento
createChild(String type)
Creates and registers a new child memento.String
get(String key)
Memento
getChild(String type)
Iterable<Memento>
getChildren()
Retrieves a point-time read-only copy of all the children mementos.Iterable<Memento>
getChildren(String type)
Retrieves a point-time read-only copy of all the children mementos of the specified type.Iterable<String>
getKeys()
Retrieves a read-only collection of registered property keys.String
getText()
String
getType()
Returns the value of type for the memento.void
put(String key, String value)
void
setText(String text)
-
-
-
Method Detail
-
getType
String getType()
Returns the value of type for the memento. The value of null is returned if no type has been set.
-
put
void put(String key, String value)
- Parameters:
key
-null
doesn't make sensevalue
-null
value effectively removes the key
-
getKeys
Iterable<String> getKeys()
Retrieves a read-only collection of registered property keys. Since the collection is backed by the original collection, new properties must not be added while iterating.
-
getText
String getText()
-
setText
void setText(String text)
-
getChildren
Iterable<Memento> getChildren(String type)
Retrieves a point-time read-only copy of all the children mementos of the specified type. Subsequent modifications to the original list of children of the current memento will not have any impact on the returned collection.
-
getChildren
Iterable<Memento> getChildren()
Retrieves a point-time read-only copy of all the children mementos. Subsequent modifications to the original list of children of the current memento will not have any impact on the returned collection.
-
copy
Memento copy()
Returns a deep copy of the current memento and its children
-
-