+/EE422C

software design

git clone https://git.julia.blue/+/EE422C

Joseph RyanAdd the rest of the files7e47727

master
1.1 KiB55 linesraw
1/*
2 * Phase A <studentA EID><studentB EID>
3 * Phase B <studentB EID><studentA EID>
4 */
5
6package pmap.phasea;
7
8/**
9 * A map entry (key-value pair), assuming that the key and value are
10 * both integers.
11 */
12public class PEntry {
13
14    private Integer key;
15    private Integer value;
16
17    /**
18     * Constructor.
19     *
20     * @param key key to be stored in this entry
21     * @param value value to be stored in this entry
22     */
23    public PEntry(Integer key, Integer value) {
24        this.key = key;
25        this.value = value;
26    }
27
28    /**
29     * Returns the key corresponding to this entry.
30     * 
31     * @return the key corresponding to this entry
32     */
33    public Integer getKey() {
34        return key;
35    }
36
37    /**
38     * Returns the value corresponding to this entry.
39     *
40     * @return the value corresponding to this entry
41     */
42    public Integer getValue() {
43        return value;
44    }
45
46    /**
47     * Replaces the value corresponding to this entry with the
48     * specified value.
49     *
50     * @param value new value to be stored in this entry
51     */
52    public void setValue(Integer value) {
53        this.value = value;
54    }
55}