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>, YamlCollection


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 String getString(int i)
public int getInteger(int i)
public Number getDouble(int i)
public boolean getBoolean(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 boolean isExpanded()
public void setExpanded(boolean expanded)
public Iterator<YamlNode> iterator() Returns Iterator instance
public void accept(YamlVisitor visitor)

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:

YamlCollection


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:

YamlCollection


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)

Specified By:

SequenceAstNode


getSequence

public YamlSequence getSequence(int i)

Specified By:

SequenceAstNode


getScalar

public YamlScalar getScalar(int i)

Specified By:

SequenceAstNode


getString

public String getString(int i)

Specified By:

SequenceAstNode


getInteger

public int getInteger(int i)

Specified By:

SequenceAstNode


getDouble

public Number getDouble(int i)

Specified By:

SequenceAstNode


getBoolean

public boolean getBoolean(int i)

Specified By:

SequenceAstNode


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


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