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 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:
remove
public YamlSequence remove(int index)
Specified By:
clear
public YamlSequence clear()
Specified By:
add
public YamlSequence add(YamlNode item)
Appends an item to the sequence.
size
public int size()
Specified By:
get
public YamlNode get(int index)
Specified By:
getFirst
public YamlNode getFirst()
Specified By:
getLast
public YamlNode getLast()
Specified By:
getMap
public YamlMap getMap(int i)
getSequence
public YamlSequence getSequence(int i)
getScalar
public YamlScalar getScalar(int i)
getString
public String getString(int i)
getInteger
public int getInteger(int i)
getElements
public List<YamlNode> getElements()
Specified By:
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:
isExpanded
public boolean isExpanded()
setExpanded
public void setExpanded(boolean expanded)
iterator
public Iterator<YamlNode> iterator()
Returns Iterator instance
Specified By:
accept
public void accept(YamlVisitor visitor)
Overrides: