FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaDataStructures/HuffmanFunctionalProgramming/Leaf.java at master · benaich/JavaDataStructures · GitHub
benaich
/
JavaDataStructures
Public
Notifications
You must be signed in to change notification settings
Fork
7
Star
2
Code
Issues
0
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaDataStructures
/
HuffmanFunctionalProgramming
/
Leaf.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
58 lines (46 loc) · 1.09 KB
Breadcrumbs
JavaDataStructures
/
HuffmanFunctionalProgramming
/
Leaf.java
Copy path
File metadata and controls
58 lines (46 loc) · 1.09 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package
HuffmanFunctionalProgramming
;
import
List
.
ListModule
;
import
List
.
ListModule
.
List
;
/**
*
* @author home
*/
public
class
Leaf
implements
CodeTree
{
private
Paire
key
;
public
Leaf
(
Paire
key
) {
this
.
key
=
key
;
}
@
Override
public
boolean
isLeaf
() {
return
true
;
}
@
Override
public
Paire
paire
() {
return
key
;
}
@
Override
public
CharBits
getChar
(
List
<
Integer
>
bits
) {
return
new
CharBits
(
bits
,
paire
().
getChars
().
head
());
}
@
Override
public
List
<
Integer
>
getCode
(
Character
car
,
List
<
Integer
>
acc
) {
return
acc
;
}
@
Override
public
List
<
Integer
>
encode
(
List
<
Character
>
chars
,
List
<
Integer
>
acc
) {
return
acc
;
}
@
Override
public
int
compareTo
(
CodeTree
n
) {
return
key
.
compareTo
(
n
.
paire
());
}
@
Override
public
String
toString
() {
return
key
.
toString
();
}
}
Back
|
FazBrowse Home
|
New Git URL