net.fortytwo.ripple
Class ListNode<T>

java.lang.Object
  extended by net.fortytwo.ripple.ListNode<T>

public abstract class ListNode<T>
extends Object

The head of an abstract linked list.

Author:
Joshua Shinavier (http://fortytwo.net)

Constructor Summary
ListNode()
           
 
Method Summary
 boolean equals(ListNode<T> other)
           
abstract  T getFirst()
           
abstract  ListNode<T> getRest()
           
abstract  boolean isNil()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListNode

public ListNode()
Method Detail

getFirst

public abstract T getFirst()
Returns:
the value at the head of the list, or null if this is a nil list

getRest

public abstract ListNode<T> getRest()
Returns:
the rest of the list, or null if this is a nil list

isNil

public abstract boolean isNil()
Returns:
whether this is a nil list node, being the terminator of any number of lists

equals

public boolean equals(ListNode<T> other)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2014. All Rights Reserved.