Public Member Functions | Protected Member Functions | Protected Attributes

antlr.collections.impl.LList Class Reference

Inheritance diagram for antlr.collections.impl.LList:
antlr.collections.List antlr.collections.Stack

List of all members.

Public Member Functions

void add (Object o)
void append (Object o)
Object elementAt (int i) throws NoSuchElementException
Enumeration elements ()
int height ()
boolean includes (Object o)
int length ()
Object pop () throws NoSuchElementException
void push (Object o)
Object top () throws NoSuchElementException

Protected Member Functions

Object deleteHead () throws NoSuchElementException
void insertHead (Object o)

Protected Attributes

LLCell head = null
LLCell tail = null
int length = 0

Detailed Description

A Linked List Implementation (not thread-safe for simplicity) (adds to the tail) (has an enumeration)


Member Function Documentation

void antlr.collections.impl.LList.add ( Object  o  ) 

Add an object to the end of the list.

Parameters:
o the object to add

References antlr.collections.impl.LList.append().

void antlr.collections.impl.LList.append ( Object  o  ) 

Append an object to the end of the list.

Parameters:
o the object to append

References antlr.collections.impl.LList.head, antlr.collections.impl.LList.length(), antlr.collections.impl.LLCell.next, and antlr.collections.impl.LList.tail.

Referenced by antlr.collections.impl.LList.add().

Object antlr.collections.impl.LList.deleteHead (  )  throws NoSuchElementException [protected]

Delete the object at the head of the list.

Returns:
the object found at the head of the list.
Exceptions:
NoSuchElementException if the list is empty.

References antlr.collections.impl.LLCell.data, antlr.collections.impl.LList.head, antlr.collections.impl.LList.length(), and antlr.collections.impl.LLCell.next.

Referenced by antlr.collections.impl.LList.pop().

Object antlr.collections.impl.LList.elementAt ( int  i  )  throws NoSuchElementException

Get the ith element in the list.

Parameters:
i the index (from 0) of the requested element.
Returns:
the object at index i NoSuchElementException is thrown if i out of range

References antlr.collections.impl.LList.head, and antlr.collections.impl.LLCell.next.

Enumeration antlr.collections.impl.LList.elements (  ) 

Return an enumeration of the list elements

int antlr.collections.impl.LList.height (  ) 

How high is the stack?

Implements antlr.collections.Stack.

References antlr.collections.impl.LList.length.

boolean antlr.collections.impl.LList.includes ( Object  o  ) 

Answers whether or not an object is contained in the list

Parameters:
o the object to test for inclusion.
Returns:
true if object is contained else false.

References antlr.collections.impl.LList.head, and antlr.collections.impl.LLCell.next.

void antlr.collections.impl.LList.insertHead ( Object  o  )  [protected]

Insert an object at the head of the list.

Parameters:
o the object to add

References antlr.collections.impl.LList.head, antlr.collections.impl.LList.length(), antlr.collections.impl.LLCell.next, and antlr.collections.impl.LList.tail.

Referenced by antlr.collections.impl.LList.push().

Object antlr.collections.impl.LList.pop (  )  throws NoSuchElementException

Pop the top element of the stack off.

Returns:
the top of stack that was popped off.
Exceptions:
NoSuchElementException if the stack is empty.

Implements antlr.collections.Stack.

References antlr.collections.impl.LList.deleteHead().

void antlr.collections.impl.LList.push ( Object  o  ) 

Push an object onto the stack.

Parameters:
o the object to push

Implements antlr.collections.Stack.

References antlr.collections.impl.LList.insertHead().

Object antlr.collections.impl.LList.top (  )  throws NoSuchElementException

Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties