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>
public class YamlMap
extends YamlNode
Constructor Summary
| Constructor | Description |
|---|---|
| YamlMap() | |
| YamlMap(YamlToken token, YamlOptions options) |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
| public boolean | isEmpty() | |
| public int | size() | |
| public boolean | containsKey(YamlNode key) | |
| public YamlNode | get(YamlNode key) | |
| public List<YamlMapEntry> | getChildren() | Implementation-specific nodes must return their constituent children. For example, a Map node returns its entries. |
| public YamlMapEntry | getEntry(YamlNode key) | |
| public YamlMapEntry | getEntry(int i) | |
| public List<YamlMapEntry> | getEntries() | |
| public NodeStyle | getStyle() | |
| public Set<YamlNode> | keySet() | |
| public YamlMap | put(YamlNode key, YamlNode value) | |
| public YamlMap | remove(YamlNode key) | |
| public YamlMap | remove(String key) | |
| public YamlMap | setStyle(NodeStyle style) | |
| public boolean | containsKey(String key) | |
| public YamlNode | get(String key) | |
| public YamlMap | getMap(String key) | |
| public YamlSequence | getSequence(String key) | |
| public YamlScalar | getScalar(String 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
getNodeStyle, getOptions, getTag, setAnchor, getStartColumn, addComments, getStartLine, hashCode, getEndColumn, getEndLine, getComments, setTag, setNodeStyle, addComment, getToken, getAnchor, equals
Method Details
isEmpty
public boolean isEmpty()
Specified By:
size
public int size()
Specified By:
containsKey
public boolean containsKey(YamlNode key)
get
@io.github.qishr.cascara.common.lang.annotation.Nullable
public YamlNode get(YamlNode key)
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.lang.annotation.Nullable
public YamlMapEntry getEntry(YamlNode key)
getEntry
@io.github.qishr.cascara.common.lang.annotation.Nullable
public YamlMapEntry getEntry(int i)
Specified By:
getEntries
public List<YamlMapEntry> getEntries()
Specified By:
getStyle
public NodeStyle getStyle()
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:
setStyle
public YamlMap setStyle(NodeStyle style)
containsKey
public boolean containsKey(String key)
Specified By:
get
@io.github.qishr.cascara.common.lang.annotation.Nullable
public YamlNode get(String key)
Specified By:
getMap
@io.github.qishr.cascara.common.lang.annotation.Nullable
public YamlMap getMap(String key)
Specified By:
getSequence
@io.github.qishr.cascara.common.lang.annotation.Nullable
public YamlSequence getSequence(String key)
Specified By:
getScalar
@io.github.qishr.cascara.common.lang.annotation.Nullable
public YamlScalar getScalar(String 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()