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 (IAlgo, Object, LRStruct)
Calls the IAlgo visitor's empty case
 o getFirst (LRStruct)
Throws java
 o getRest (LRStruct)
Throws java
 o insertFront (Object, LRStruct)
The owner becomes non-empty and has dat as its first element
 o removeFront (LRStruct)
Throws java
 o setFirst (Object, LRStruct)
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 tail, LRStruct owner)
Throws java.util.NoSuchElementException.

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

 o insertFront
LRStruct insertFront(Object dat, LRStruct owner)
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(IAlgo algo, Object inp, LRStruct owner)
Calls the IAlgo visitor's empty case.