Skip to content

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:

MapAstNode


size

public int size()

Specified By:

MapAstNode


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:

MapAstNode

Overrides:

YamlNode


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:

MapAstNode


getEntries

public List<YamlMapEntry> getEntries()

Specified By:

MapAstNode


getStyle

public NodeStyle getStyle()


keySet

public Set<YamlNode> keySet()

Specified By:

MapAstNode


put

public YamlMap put(YamlNode key, YamlNode value)


remove

public YamlMap remove(YamlNode key)


remove

public YamlMap remove(String key)

Specified By:

MapAstNode


setStyle

public YamlMap setStyle(NodeStyle style)


containsKey

public boolean containsKey(String key)

Specified By:

MapAstNode


get

@io.github.qishr.cascara.common.lang.annotation.Nullable
public YamlNode get(String key)

Specified By:

MapAstNode


getMap

@io.github.qishr.cascara.common.lang.annotation.Nullable
public YamlMap getMap(String key)

Specified By:

MapAstNode


getSequence

@io.github.qishr.cascara.common.lang.annotation.Nullable
public YamlSequence getSequence(String key)

Specified By:

MapAstNode


getScalar

@io.github.qishr.cascara.common.lang.annotation.Nullable
public YamlScalar getScalar(String key)

Specified By:

MapAstNode


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:

MapAstNode


values

public List<YamlNode> values()

Specified By:

MapAstNode


put

public YamlMap put(String key, String value)

Specified By:

MapAstNode


accept

public void accept(YamlVisitor visitor)

Overrides:

YamlNode


iterator

public Iterator<YamlMapEntry> iterator()