75 |
irasnyd |
1 |
//Ira Snyder
|
|
|
2 |
//CS241 Section 01
|
|
|
3 |
//Project #1
|
|
|
4 |
//Due: 10-22-2004
|
|
|
5 |
//NOTE: Helped Allen Oliver with his project also, since mine was
|
|
|
6 |
// done by the time he started his.
|
|
|
7 |
|
6 |
irasnyd |
8 |
public interface Map {
|
|
|
9 |
public Object get(Object key);
|
|
|
10 |
// RETURN: value;
|
|
|
11 |
// POST: if value!=null, then (key,value) is in this map;
|
|
|
12 |
// if value==null, then no record in this map has the given key;
|
|
|
13 |
public Object put(Object key, Object value);
|
|
|
14 |
// RETURN: oldValue;
|
|
|
15 |
// POST: if oldValue==null, then (key,value) is in this map;
|
|
|
16 |
// if oldValue!=null, then (key,oldValue) was in this map;
|
|
|
17 |
public Object remove(Object key);
|
|
|
18 |
// RETURN: oldValue;
|
|
|
19 |
// POST: if oldValue==null, no record in this map has the given key;
|
|
|
20 |
// if oldValue!=null, then (key,oldValue) was in this map;
|
|
|
21 |
public int size();
|
|
|
22 |
// RETURN: n;
|
|
|
23 |
// POST: this map contains n records;
|
|
|
24 |
}
|
|
|
25 |
|