Top Description Fields Constructors Methods
org.snakeyaml.engine.v2.common

public Class ArrayStack<T>

extends Object
Class Inheritance
Type Parameters
<T>
data to keep in stack
Imports
java.util.ArrayList

Custom stack

Field Summary

Modifier and TypeField and Description
private final ArrayList<T>

Constructor Summary

AccessConstructor and Description
public
ArrayStack(int
- the initial size of the stack
initSize
)

Create empty stack

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true when it contains nothing
isEmpty
()

Check

public T

Returns:

the head
pop
()

Get the head and remove it from the stack

public void
push(T
- data to be added
obj
)

Add the element to the head

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

stackback to summary
private final ArrayList<T> stack

Constructor Detail

ArrayStackback to summary
public ArrayStack(int initSize)

Create empty stack

Parameters
initSize:int

- the initial size of the stack

Method Detail

isEmptyback to summary
public boolean isEmpty()

Check

Returns:boolean

true when it contains nothing

popback to summary
public T pop()

Get the head and remove it from the stack

Returns:T

the head

pushback to summary
public void push(T obj)

Add the element to the head

Parameters
obj:T

- data to be added