35
35
* An Extremely Fast Tagged Attribute Read-only File System.
36
36
* Created on October 12, 2005
37
37
*
38
- * A Eftar File has the following format
38
+ * <i>Eftar</i> File has the following format
39
+ * <code>
39
40
* FILE --> Record ( Record | tagString ) *
41
+ * <br>
40
42
* Record --> 64bit:Hash 16bit:childrenOffset 16bit:(numberChildren|lenthOfTag) 16bit:tagOffset
43
+ * </code>
41
44
*
42
- * It is a tree of tagged names,
43
- * doing binary search in sorted list of children
45
+ * It is a tree of tagged names, doing binary search in sorted list of children
44
46
*
45
47
* @author Chandan
46
48
*/
@@ -52,11 +54,11 @@ public class EftarFile {
52
54
53
55
static class Node {
54
56
55
- public long hash ;
56
- public String tag ;
57
- public Map <Long , Node > children ;
58
- public long tagOffset ;
59
- public long childOffset ;
57
+ private final long hash ;
58
+ private String tag ;
59
+ private final Map <Long , Node > children ;
60
+ private long tagOffset ;
61
+ private long childOffset ;
60
62
61
63
Node (long hash , String tag ) {
62
64
this .hash = hash ;
@@ -65,10 +67,7 @@ static class Node {
65
67
}
66
68
67
69
public Node put (long hash , String desc ) {
68
- if (children .get (hash ) == null ) {
69
- children .put (hash , new Node (hash , desc ));
70
- }
71
- return children .get (hash );
70
+ return children .computeIfAbsent (hash , newNode -> new Node (hash , desc ));
72
71
}
73
72
74
73
public Node get (long hash ) {
0 commit comments