Skip to content

Commit 2a0c823

Browse files
Scott L. BursonScott L. Burson
authored andcommitted
Internal FHashMap improvements; better union operation.
The hash codes of node keys are now cached, improving performance, particularly on `get`s. `FMap.union` now accepts an optional value combiner, making it more general.
1 parent a72c3d7 commit 2a0c823

File tree

6 files changed

+263
-175
lines changed

6 files changed

+263
-175
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ test:
55
java com/ergy/fset/TestSuite 10000 >& test.out
66

77
doc:
8-
javadoc -link http://docs.oracle.com/javase/7/docs/api/ -d Doc/JavaDoc com/ergy/fset/{F,AbstractF}*.java
8+
javadoc -link http://docs.oracle.com/javase/7/docs/api/ -d Doc/JavaDoc com/ergy/fset/{F,AbstractF,BinaryOp}*.java
99

1010
fset.jar: all com/ergy/fset/*.class
1111
jar cf fset.jar com/ergy/fset/*.class

com/ergy/fset/BinaryOp.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* BinaryOp.java
3+
*
4+
* Copyright (c) 2013, 2014 Scott L. Burson.
5+
*
6+
* This file is licensed under the Library GNU Public License (LGPL), v. 2.1.
7+
*/
8+
9+
10+
package com.ergy.fset;
11+
12+
/**
13+
* A binary operation of type (T, T) -> T.
14+
*/
15+
public interface BinaryOp<T> {
16+
17+
T apply(T x, T y);
18+
19+
}

0 commit comments

Comments
 (0)