Skip to content

Package io.github.qishr.cascara.lang.yaml.ast

Class YamlSequence

java.lang.Object
        io.github.qishr.cascara.lang.yaml.ast.YamlNode
                io.github.qishr.cascara.lang.yaml.ast.YamlSequence

All Implemented Interfaces:
    SequenceAstNode<YamlNode>


public class YamlSequence
extends YamlNode

Represents a YAML sequence (a list of items).

Constructor Summary

Constructor Description
YamlSequence()
YamlSequence(YamlToken token)

Method Summary

Modifier and Type Method Description
public boolean isEmpty()
public YamlSequence remove(int index)
public YamlSequence clear()
public YamlSequence add(YamlNode item) Appends an item to the sequence.
public int size()
public YamlNode get(int index)
public YamlNode getFirst()
public YamlNode getLast()
public YamlMap getMap(int i)
public YamlSequence getSequence(int i)
public YamlScalar getScalar(int i)
public List<YamlNode> getElements()
public YamlSequence remove(YamlNode node)
public List<YamlNode> getChildren() Implementation-specific nodes must return their constituent children. For example, a Map node returns its entries.
public NodeStyle getStyle()
public YamlSequence setStyle(NodeStyle style)
public boolean isExpanded()
public void setExpanded(boolean expanded)
public Iterator<YamlNode> iterator() Returns Iterator instance
public void accept(YamlVisitor visitor)

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:

SequenceAstNode


remove

public YamlSequence remove(int index)

Specified By:

SequenceAstNode


clear

public YamlSequence clear()

Specified By:

SequenceAstNode


add

public YamlSequence add(YamlNode item)

Appends an item to the sequence.


size

public int size()

Specified By:

SequenceAstNode


get

public YamlNode get(int index)

Specified By:

SequenceAstNode


getFirst

public YamlNode getFirst()

Specified By:

SequenceAstNode


getLast

public YamlNode getLast()

Specified By:

SequenceAstNode


getMap

public YamlMap getMap(int i)


getSequence

public YamlSequence getSequence(int i)


getScalar

public YamlScalar getScalar(int i)


getElements

public List<YamlNode> getElements()

Specified By:

SequenceAstNode


remove

public YamlSequence remove(YamlNode node)


getChildren

public List<YamlNode> getChildren()

Implementation-specific nodes must return their constituent children. For example, a Map node returns its entries.

Overrides:

YamlNode


getStyle

public NodeStyle getStyle()


setStyle

public YamlSequence setStyle(NodeStyle style)


isExpanded

public boolean isExpanded()


setExpanded

public void setExpanded(boolean expanded)


iterator

public Iterator<YamlNode> iterator()

Returns Iterator instance

Specified By:

SequenceAstNode


accept

public void accept(YamlVisitor visitor)

Overrides:

YamlNode