Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 749b3ad

Browse files
committed
use java 8 syntax - SegmentTreeFactoryByArrayImplementation
1 parent 38ed97f commit 749b3ad

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed
Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11
package org.psjava.ds.tree.segmenttree;
22

3-
import org.psjava.ds.array.PSArray;
4-
import org.psjava.ds.math.BinaryOperator;
5-
63
public class SegmentTreeFactoryByArrayImplementation {
74

85
public static SegmentTreeFactory getInstance() {
9-
return new SegmentTreeFactory() {
10-
@Override
11-
public <T> SegmentTree<T> create(PSArray<T> initialList, BinaryOperator<T> operator) {
12-
return new SegmentTreeByArrayImplementation<T>(initialList, operator);
13-
}
14-
};
15-
}
16-
17-
private SegmentTreeFactoryByArrayImplementation() {
6+
return SegmentTreeByArrayImplementation::new;
187
}
198

209
}

0 commit comments

Comments
 (0)