Class lrs.EmptyNode


class EmptyNode
extends lrs.ANode
Represents the empty state of a mutable list LRStruct. Uses the Singleton pattern.

Author:
Dung X. Nguyen Copyright 2001 - All rights reserved.

Variable Index

 o Singleton
Singleton Pattern

Constructor Index

 o EmptyNode ()

Method Index

 o execute (LRStruct, IAlgo, Object[])
Calls the IAlgo visitor's empty case
 o getFirst (LRStruct)
Throws java
 o getRest (LRStruct)
Throws java
 o insertFront (LRStruct, Object)
The owner becomes non-empty and has dat as its first element
 o removeFront (LRStruct)
Throws java
 o setFirst (LRStruct, Object)
Throws java
 o setRest (LRStruct, LRStruct)
Throws java

Variables

 o Singleton
static final EmptyNode Singleton = new EmptyNode()
Singleton Pattern.

Constructors

 o EmptyNode
private  EmptyNode()

Methods

 o getRest
LRStruct getRest(LRStruct owner)
Throws java.util.NoSuchElementException.

 o getFirst
Object getFirst(LRStruct owner)
Throws java.util.NoSuchElementException.

 o setRest
LRStruct setRest(LRStruct owner, LRStruct tail)
Throws java.util.NoSuchElementException.

 o setFirst
LRStruct setFirst(LRStruct owner, Object dat)
Throws java.util.NoSuchElementException.

 o insertFront
LRStruct insertFront(LRStruct owner, Object dat)
The owner becomes non-empty and has dat as its first element.

 o removeFront
Object removeFront(LRStruct owner)
Throws java.util.NoSuchElementException.

 o execute
Object execute(LRStruct owner, IAlgo algo, Object[] inp)
Calls the IAlgo visitor's empty case.