提交 c3780d9d authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Remove ValueHashMap.newInstance()

上级 77ab3a41
...@@ -38,7 +38,7 @@ class AggregateDataHistogram extends AggregateData { ...@@ -38,7 +38,7 @@ class AggregateDataHistogram extends AggregateData {
@Override @Override
void add(Database database, int dataType, Value v) { void add(Database database, int dataType, Value v) {
if (distinctValues == null) { if (distinctValues == null) {
distinctValues = ValueHashMap.newInstance(); distinctValues = new ValueHashMap<>();
} }
LongDataCounter a = distinctValues.get(v); LongDataCounter a = distinctValues.get(v);
if (a == null) { if (a == null) {
......
...@@ -25,7 +25,7 @@ class AggregateDataMode extends AggregateData { ...@@ -25,7 +25,7 @@ class AggregateDataMode extends AggregateData {
return; return;
} }
if (distinctValues == null) { if (distinctValues == null) {
distinctValues = ValueHashMap.newInstance(); distinctValues = new ValueHashMap<>();
} }
LongDataCounter a = distinctValues.get(v); LongDataCounter a = distinctValues.get(v);
if (a == null) { if (a == null) {
......
...@@ -40,7 +40,7 @@ public class HashIndex extends BaseIndex { ...@@ -40,7 +40,7 @@ public class HashIndex extends BaseIndex {
} }
private void reset() { private void reset() {
rows = ValueHashMap.newInstance(); rows = new ValueHashMap<>();
} }
@Override @Override
......
...@@ -45,7 +45,7 @@ public class NonUniqueHashIndex extends BaseIndex { ...@@ -45,7 +45,7 @@ public class NonUniqueHashIndex extends BaseIndex {
} }
private void reset() { private void reset() {
rows = ValueHashMap.newInstance(); rows = new ValueHashMap<>();
rowCount = 0; rowCount = 0;
} }
......
...@@ -147,7 +147,7 @@ public class LocalResultImpl implements LocalResult { ...@@ -147,7 +147,7 @@ public class LocalResultImpl implements LocalResult {
public void setDistinct() { public void setDistinct() {
assert distinctIndexes == null; assert distinctIndexes == null;
distinct = true; distinct = true;
distinctRows = ValueHashMap.newInstance(); distinctRows = new ValueHashMap<>();
} }
/** /**
...@@ -159,7 +159,7 @@ public class LocalResultImpl implements LocalResult { ...@@ -159,7 +159,7 @@ public class LocalResultImpl implements LocalResult {
public void setDistinct(int[] distinctIndexes) { public void setDistinct(int[] distinctIndexes) {
assert !distinct; assert !distinct;
this.distinctIndexes = distinctIndexes; this.distinctIndexes = distinctIndexes;
distinctRows = ValueHashMap.newInstance(); distinctRows = new ValueHashMap<>();
} }
/** /**
...@@ -202,7 +202,7 @@ public class LocalResultImpl implements LocalResult { ...@@ -202,7 +202,7 @@ public class LocalResultImpl implements LocalResult {
return external.contains(values); return external.contains(values);
} }
if (distinctRows == null) { if (distinctRows == null) {
distinctRows = ValueHashMap.newInstance(); distinctRows = new ValueHashMap<>();
for (Value[] row : rows) { for (Value[] row : rows) {
ValueArray array = getArrayOfDistinct(row); ValueArray array = getArrayOfDistinct(row);
distinctRows.put(array, array.getList()); distinctRows.put(array, array.getList());
......
...@@ -38,15 +38,6 @@ public class ValueHashMap<V> extends HashBase { ...@@ -38,15 +38,6 @@ public class ValueHashMap<V> extends HashBase {
Value[] keys; Value[] keys;
V[] values; V[] values;
/**
* Create a new value hash map.
*
* @return the object
*/
public static <T> ValueHashMap<T> newInstance() {
return new ValueHashMap<>();
}
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
protected void reset(int newLevel) { protected void reset(int newLevel) {
......
...@@ -47,7 +47,7 @@ public class TestValueHashMap extends TestBase implements DataHandler { ...@@ -47,7 +47,7 @@ public class TestValueHashMap extends TestBase implements DataHandler {
} }
private void testNotANumber() { private void testNotANumber() {
ValueHashMap<Integer> map = ValueHashMap.newInstance(); ValueHashMap<Integer> map = new ValueHashMap<>();
for (int i = 1; i < 100; i++) { for (int i = 1; i < 100; i++) {
double d = Double.longBitsToDouble(0x7ff0000000000000L | i); double d = Double.longBitsToDouble(0x7ff0000000000000L | i);
ValueDouble v = ValueDouble.get(d); ValueDouble v = ValueDouble.get(d);
...@@ -57,7 +57,7 @@ public class TestValueHashMap extends TestBase implements DataHandler { ...@@ -57,7 +57,7 @@ public class TestValueHashMap extends TestBase implements DataHandler {
} }
private void testRandomized() { private void testRandomized() {
ValueHashMap<Value> map = ValueHashMap.newInstance(); ValueHashMap<Value> map = new ValueHashMap<>();
HashMap<Value, Value> hash = new HashMap<>(); HashMap<Value, Value> hash = new HashMap<>();
Random random = new Random(1); Random random = new Random(1);
Comparator<Value> vc = new Comparator<Value>() { Comparator<Value> vc = new Comparator<Value>() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论