Class CoreMemory
java.lang.Object
me.neurodock.core.memory.CoreMemory
CoreMemory is a class that provides a way to store and retrieve strings from a file.
This is meant to be used as a way to store and retrieve strings from a file.
This is meant to be used as a way to store and retrieve strings from a file.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an array-based memoryvoidAdd an array-based memoryvoidSets the memory.org.json.JSONArrayGet all array-stored memoriesstatic CoreMemoryGets the singleton instance of CoreMemory.Gets all memories as a JSON string.String[]Gets the memory.getMemory(int index) Get the array-based memory at indexvoidremoveMemory(String name) Removes the memory.
-
Field Details
-
VERSION
public static final int VERSION- See Also:
-
MAPPED_MEMORY
Memory type identifier for key-value mapped memory storage.- See Also:
-
ARRAYED_MEMORY
Memory type identifier for sequential/array-based memory storage.- See Also:
-
-
Constructor Details
-
CoreMemory
Creates a new instance of CoreMemory.- Parameters:
memoryFile- The file to store the memory in
-
-
Method Details
-
getInstance
Gets the singleton instance of CoreMemory.- Returns:
- The singleton instance of CoreMemory
-
getMemoriesIdentity
-
getMemory
-
addMemory
-
removeMemory
-
addMemory
Add an array-based memory- Parameters:
memory- The memory to remember
-
addMemory
Add an array-based memory- Parameters:
memory- The memory to rememberindex- The index to put it at
-
getArrayMemories
public org.json.JSONArray getArrayMemories()Get all array-stored memories- Returns:
- An array of all array-based memories
-
getMemory
-
getMappedMemories
Gets all memories as a JSON string.- Returns:
- A JSON string of all memories
-
getMemoriesArray
-