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:
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)
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:
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:
accept
public void accept(YamlVisitor visitor)
Overrides: