Package io.github.qishr.cascara.lang.yaml.ast
Class YamlMap
java.lang.Object
io.github.qishr.cascara.lang.yaml.ast.YamlNode
io.github.qishr.cascara.lang.yaml.ast.YamlMap
All Implemented Interfaces:
MapAstNode<YamlNode, YamlNode, YamlMapEntry>, YamlCollection
public class YamlMap
extends YamlNode
Constructor Summary
| Constructor | Description |
|---|---|
| YamlMap() | |
| YamlMap(YamlToken token, YamlOptions options) | |
| YamlMap(YamlToken token, int line, int column, YamlOptions options) |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
| public boolean | isEmpty() | |
| public int | size() | |
| public boolean | containsKey(Object key) | |
| public YamlNode | get(Object key) | |
| public List<YamlMapEntry> | getChildren() | Implementation-specific nodes must return their constituent children. For example, a Map node returns its entries. |
| public YamlMapEntry | getEntry(Object key) | |
| public YamlMapEntry | getEntry(int i) | |
| public List<YamlMapEntry> | getEntries() | |
| public Set<YamlNode> | keySet() | |
| public YamlMap | put(YamlNode key, YamlNode value) | |
| public YamlMap | remove(YamlNode key) | |
| public YamlMap | remove(String key) | |
| public YamlMap | getMap(Object key) | |
| public YamlSequence | getSequence(Object key) | |
| public YamlScalar | getScalar(Object key) | |
| public YamlMap | put(String key, YamlNode value) | Associates the specified value with the specified string key. |
| public YamlMap | put(YamlMapEntry entry) | |
| public Set<YamlMapEntry> | entrySet() | |
| public List<YamlNode> | values() | |
| public YamlMap | put(String key, String value) | |
| public void | accept(YamlVisitor visitor) | |
| public Iterator<YamlMapEntry> | iterator() |
Methods inherited from YamlNode
isPreceededByNewLine, getOptions, setFileEndsWithNewLine, getTag, setAnchor, addComments, getStartLine, hashCode, fileEndsWithNewLine, getEndColumn, setTag, addComment, setPreceededByNewLine, getResolvedTag, getToken, getAnchor, getNodeStyle, toString, setNodeStyle, getStartColumn, getSemanticColumn, getEndLine, getComments, getProperties, equals, setResolvedTag, setSemanticColumn
Method Details
isEmpty
public boolean isEmpty()
Specified By:
size
public int size()
Specified By:
containsKey
public boolean containsKey(Object key)
Specified By:
get
@io.github.qishr.cascara.common.annotation.Nullable
public YamlNode get(Object key)
Specified By:
getChildren
public List<YamlMapEntry> getChildren()
Implementation-specific nodes must return their constituent children. For example, a Map node returns its entries.
Specified By:
Overrides:
getEntry
@io.github.qishr.cascara.common.annotation.Nullable
public YamlMapEntry getEntry(Object key)
Specified By:
getEntry
@io.github.qishr.cascara.common.annotation.Nullable
public YamlMapEntry getEntry(int i)
Specified By:
getEntries
public List<YamlMapEntry> getEntries()
Specified By:
keySet
Specified By:
put
public YamlMap put(YamlNode key, YamlNode value)
remove
public YamlMap remove(YamlNode key)
remove
public YamlMap remove(String key)
Specified By:
getMap
@io.github.qishr.cascara.common.annotation.Nullable
public YamlMap getMap(Object key)
Specified By:
getSequence
@io.github.qishr.cascara.common.annotation.Nullable
public YamlSequence getSequence(Object key)
Specified By:
getScalar
@io.github.qishr.cascara.common.annotation.Nullable
public YamlScalar getScalar(Object key)
Specified By:
put
public YamlMap put(String key, YamlNode value)
Associates the specified value with the specified string key.If the map previously contained a mapping for the key, the old value is replaced. This method automatically wraps the string in a PLAIN scalar node.
Parameters:
key - The string key to be associated with the value.
value - The value node to be associated with the key.
put
public YamlMap put(YamlMapEntry entry)
entrySet
public Set<YamlMapEntry> entrySet()
Specified By:
values
public List<YamlNode> values()
Specified By:
put
public YamlMap put(String key, String value)
Specified By:
accept
public void accept(YamlVisitor visitor)
Overrides:
iterator
public Iterator<YamlMapEntry> iterator()