-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCode.java
More file actions
33 lines (25 loc) · 763 Bytes
/
Code.java
File metadata and controls
33 lines (25 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package huffmancoding;
/**
* An object representing a unique Huffman code, with data fields corresponding
* to the character and its frequency and encoding.
*/
public class Code {
private Character character;
private int frequency;
private String encoding;
public Code(Character c, int freq, String code) {
this.character = c;
this.frequency = freq;
this.encoding = code;
}
//////////////////////////////ACCESSORS/////////////////////////////////////
public Character getCharacter() {
return this.character;
}
public int getFrequency() {
return this.frequency;
}
public String getEncoding() {
return this.encoding;
}
}