A C G I L M N S T

A

addFirst(Comparable) - Method in class LinkedList
Inserts a Comparable item at the beginning of the list

C

compareTo(Object) - Method in class Node
Compares value of Node to the parameter and returns: -1 if the Node is less than the parameter, 0 if the Node is equal to the parameter, and 1 if the Node is greater than the parameter
compareTo(Object) - Method in class Snack
This compares two Snacks based on their tradeNames It returns 0 if the two Snacks have the same tradeName and non-0, otherwise.

G

getData() - Method in class Node
Returns reference to the data value of the object
getIngredients() - Method in class Snack
This returns the ingredients of the Snack, as a list of Strings stored within a Vector.
getNext() - Method in class Node
Returns reference to the next Node
getPriceInDollarsAndCents() - Method in class Snack
This is returns the selling price of the Snack
getTradeName() - Method in class Snack
This is returns the trade name of a Snack

I

isEmpty() - Method in class LinkedList
Tests list to see if it is empty

L

LinkedList - class LinkedList.
Class LinkedList A minimal LinkedList class composed of Node objects for 15-111/200 Mastery Exam/Fall 2002 You need to add a method to this class as described in the instructions.
LinkedList() - Constructor for class LinkedList
Default constructor: sets head to null, count to 0

M

main(String[]) - Static method in class SnackMachine
This is the test program.

N

Node - class Node.
A object of the class, Node has an object that contains a reference to an object of type Comparable and a reference to another Node.
Node(Comparable) - Constructor for class Node
Constructor builds the Node with the supplied parameter
Node(Comparable, Node) - Constructor for class Node
Constructor builds the Node with the supplied parameters

S

setNext(Node) - Method in class Node
Sets the next reference of this object to the paramter object
size() - Method in class LinkedList
Returns the number of nodes in the list
Snack - class Snack.
 
Snack(String, Vector, double) - Constructor for class Snack
This is the constructor of a Snack
SnackMachine - class SnackMachine.
 
SnackMachine(String) - Constructor for class SnackMachine
The constructor.

T

toString() - Method in class LinkedList
Returns a string representation of the list
toString() - Method in class Node
Returns string representation of the object
toString() - Method in class Snack
Returns a String representation of a Snack including the tradeName, ingredients and priceInDollarsAndCents

A C G I L M N S T