Algorithms and OOD (CSC 207 2014S) : EBoards
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] - [FAQ] [Teaching & Learning] [Grading] [Rubric] - [Calendar]
Current: [Assignment] [EBoard] [Lab] [Outline] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Partners] [Readings]
Reference: [Java 7 API] [Java Code Conventions] [GNU Code Conventions]
Related Courses: [CSC 152 2006S (Rebelsky)] [CSC 207 2013F (Rebelsky)] [CSC 207 2013S (Walker)] [CSC 207 2011S (Weinman)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker (Course)] [Issue Tracker (Textbook)]
Overview
How will the user interact with the calculator?
Similarly to
dc. Read the inputs from stdin, print the outputs (from p and s) to stdout.
The bad version of queues has an iterator (which may be well designed). What do we have to do?
All collections have iterators, mostly so you can skim through the collection without mutating it.
ADT
Data Structure
Simple Dictionary, indexed by strings
The interface
public interface SimpleDictionary<T>
{
/**
* Change the entry for a particular index.
*/
void set(String index, T value);
/**
* Remove a value based on its index.
*/
void remove(String index);
/**
* Remove everything.
*/
void clear();
/**
* Remove all the entries with a given value.
*/
void removeAll(T val);
/**
* Get all of the indices in the dictionary.
*/
Iterator<String> indices();
/**
* Get all of the values in the dictionary.
*/
Iterator<T> iterator();
} // interface SimpleDictionary<T>
Generalizing: Replace "String" with a type variable
public interface Dictionary<I,T>
{
} // interface Dictionary<I,T>
Lots of related names:
Forthcoming.
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] - [FAQ] [Teaching & Learning] [Grading] [Rubric] - [Calendar]
Current: [Assignment] [EBoard] [Lab] [Outline] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Partners] [Readings]
Reference: [Java 7 API] [Java Code Conventions] [GNU Code Conventions]
Related Courses: [CSC 152 2006S (Rebelsky)] [CSC 207 2013F (Rebelsky)] [CSC 207 2013S (Walker)] [CSC 207 2011S (Weinman)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker (Course)] [Issue Tracker (Textbook)]
Copyright (c) 2013-14 Samuel A. Rebelsky.

This work is licensed under a Creative Commons Attribution 3.0 Unported License. To view a copy of this
license, visit http://creativecommons.org/licenses/by/3.0/
or send a letter to Creative Commons, 543 Howard Street, 5th Floor,
San Francisco, California, 94105, USA.