Package org.qdl_lang.functions
Class FStack<V extends FTable<? extends FKey,? extends FunctionRecord>>
- java.lang.Object
-
- org.qdl_lang.state.XStack<V>
-
- org.qdl_lang.functions.FStack<V>
-
- All Implemented Interfaces:
Serializable
,Documentable
public class FStack<V extends FTable<? extends FKey,? extends FunctionRecord>> extends XStack<V> implements Serializable, Documentable
Created by Jeff Gaynor
on 3/15/21 at 6:22 AM- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FStack()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fromXML(XMLEventReader xer, QDLInterpreter qi)
List<FunctionRecordInterface>
getByAllName(String name)
Returns all of the named functions for any arg count.List<String>
getDocumentation(String fName, int argCount)
Get the complete documentation for a specific function.List<String>
getDocumentation(FKey key)
FunctionRecord
getFunctionReference(String name)
XStack
getStateStack(State state)
This gets the stack corresponding to this class from the state..String
getXMLStackTag()
String
getXMLTableTag()
List<String>
listAllDocs()
Return the first lines of all the function documentation this module knows.List<String>
listAllDocs(String functionName)
Return the first line of all documentation for the given function name.Set<DyadicFunctionReferenceNode>
listFunctionReferences(String regex)
TreeSet<String>
listFunctions(String regex)
List first lines of function documentation given a regular expression.XStack
newInstance()
XTable
newTableInstance()
void
setStateStack(State state, XStack xStack)
This sets the stack corresponding to this class from the state with the given stack.-
Methods inherited from class org.qdl_lang.state.XStack
addTables, allKeys, append, appendTables, clear, clone, containsKey, containsKey, deserializeFromJSON, deserializeFromJSONNEW, deserializeFromJSONOLD, fromJSON, fromXML, fromXMLNEW, get, getAll, getJSON, getLocal, getRoot, getStack, isEmpty, keySet, localGet, localHas, localPut, localRemove, main, nonlocalGet, peek, push, pushNewTable, put, put, remove, serializeContent, serializeToJSON, setStack, size, toJSON, toString, toString, toXML, toXMLNEW
-
-
-
-
Method Detail
-
getFunctionReference
public FunctionRecord getFunctionReference(String name)
-
getByAllName
public List<FunctionRecordInterface> getByAllName(String name)
Returns all of the named functions for any arg count. This is needed to populate copies of local state.- Parameters:
name
-- Returns:
-
getXMLStackTag
public String getXMLStackTag()
- Specified by:
getXMLStackTag
in classXStack<V extends FTable<? extends FKey,? extends FunctionRecord>>
-
getXMLTableTag
public String getXMLTableTag()
- Specified by:
getXMLTableTag
in classXStack<V extends FTable<? extends FKey,? extends FunctionRecord>>
- Returns:
-
fromXML
public void fromXML(XMLEventReader xer, QDLInterpreter qi) throws XMLStreamException
- Specified by:
fromXML
in classXStack<V extends FTable<? extends FKey,? extends FunctionRecord>>
- Throws:
XMLStreamException
-
listFunctions
public TreeSet<String> listFunctions(String regex)
Description copied from interface:Documentable
List first lines of function documentation given a regular expression.- Specified by:
listFunctions
in interfaceDocumentable
- Returns:
-
listFunctionReferences
public Set<DyadicFunctionReferenceNode> listFunctionReferences(String regex)
-
listAllDocs
public List<String> listAllDocs()
Description copied from interface:Documentable
Return the first lines of all the function documentation this module knows.- Specified by:
listAllDocs
in interfaceDocumentable
- Returns:
-
listAllDocs
public List<String> listAllDocs(String functionName)
Description copied from interface:Documentable
Return the first line of all documentation for the given function name.- Specified by:
listAllDocs
in interfaceDocumentable
- Returns:
-
getDocumentation
public List<String> getDocumentation(String fName, int argCount)
Description copied from interface:Documentable
Get the complete documentation for a specific function.- Specified by:
getDocumentation
in interfaceDocumentable
- Returns:
-
getDocumentation
public List<String> getDocumentation(FKey key)
- Specified by:
getDocumentation
in interfaceDocumentable
-
newInstance
public XStack newInstance()
- Specified by:
newInstance
in classXStack<V extends FTable<? extends FKey,? extends FunctionRecord>>
-
newTableInstance
public XTable newTableInstance()
- Specified by:
newTableInstance
in classXStack<V extends FTable<? extends FKey,? extends FunctionRecord>>
-
setStateStack
public void setStateStack(State state, XStack xStack)
Description copied from class:XStack
This sets the stack corresponding to this class from the state with the given stack. If the stack is not of the correct type, a class cast exception will result.
We could have tried this with some type of dynamic casting, but that is messy and fragile in Java- Specified by:
setStateStack
in classXStack<V extends FTable<? extends FKey,? extends FunctionRecord>>
-
getStateStack
public XStack getStateStack(State state)
Description copied from class:XStack
This gets the stack corresponding to this class from the state..- Specified by:
getStateStack
in classXStack<V extends FTable<? extends FKey,? extends FunctionRecord>>
- Returns:
-
-