Fixed typo

This commit is contained in:
Andrea Cavalli 2019-03-07 19:02:10 +01:00
parent ca03ef4791
commit d75c00cc78
4 changed files with 38 additions and 39 deletions

View File

@ -8,7 +8,7 @@ import it.cavallium.strangedb.java.annotations.DbField;
import java.io.IOException;
public class EnhancedObjectStrandeDbList<T extends EnhancedObject> extends StrandeDbList<T> {
public class EnhancedObjectStrangeDbList<T extends EnhancedObject> extends StrangeDbList<T> {
@DbField(id = 0, type = DbDataType.REFERENCES_LIST)
private LongArrayList indices;
@ -21,11 +21,11 @@ public class EnhancedObjectStrandeDbList<T extends EnhancedObject> extends Stran
return indices;
}
public EnhancedObjectStrandeDbList() {
public EnhancedObjectStrangeDbList() {
super();
}
public EnhancedObjectStrandeDbList(IDatabaseTools databaseTools, Class<T> type) throws IOException {
public EnhancedObjectStrangeDbList(IDatabaseTools databaseTools, Class<T> type) throws IOException {
super(databaseTools);
this.type = type;
indices = new LongArrayList();

View File

@ -7,7 +7,7 @@ import it.cavallium.strangedb.java.annotations.DbField;
import java.io.IOException;
public class ObjectStrandeDbList<T> extends StrandeDbList<T> {
public class ObjectStrangeDbList<T> extends StrangeDbList<T> {
@DbField(id = 0, type = DbDataType.REFERENCES_LIST)
private LongArrayList indices;
@ -17,11 +17,11 @@ public class ObjectStrandeDbList<T> extends StrandeDbList<T> {
return indices;
}
public ObjectStrandeDbList() {
public ObjectStrangeDbList() {
super();
}
public ObjectStrandeDbList(IDatabaseTools databaseTools) throws IOException {
public ObjectStrangeDbList(IDatabaseTools databaseTools) throws IOException {
super(databaseTools);
indices = new LongArrayList();
}

View File

@ -7,17 +7,17 @@ import it.cavallium.strangedb.java.database.IDatabaseTools;
import java.io.IOException;
import java.util.StringJoiner;
public abstract class StrandeDbList<T> extends EnhancedObject {
public abstract class StrangeDbList<T> extends EnhancedObject {
private final Object indicesAccessLock = new Object();
protected abstract LongArrayList getIndices();
public StrandeDbList() {
public StrangeDbList() {
}
public StrandeDbList(IDatabaseTools databaseTools) throws IOException {
public StrangeDbList(IDatabaseTools databaseTools) throws IOException {
super(databaseTools);
}
@ -87,7 +87,7 @@ public abstract class StrandeDbList<T> extends EnhancedObject {
@Override
public String toString() {
return new StringJoiner(", ", StrandeDbList.class.getSimpleName() + "[", "]")
return new StringJoiner(", ", StrangeDbList.class.getSimpleName() + "[", "]")
.add(getIndices().size() + " items")
.toString();
}

View File

@ -3,10 +3,9 @@ package it.cavallium.strangedb.tests;
import it.cavallium.strangedb.functionalinterfaces.RunnableWithIO;
import it.cavallium.strangedb.java.annotations.*;
import it.cavallium.strangedb.java.database.DatabaseJava;
import it.cavallium.strangedb.java.objects.lists.EnhancedObjectStrandeDbList;
import it.cavallium.strangedb.java.objects.lists.ObjectStrandeDbList;
import it.cavallium.strangedb.java.objects.lists.EnhancedObjectStrangeDbList;
import it.cavallium.strangedb.java.objects.lists.ObjectStrangeDbList;
import it.unimi.dsi.fastutil.longs.LongArrayList;
import it.cavallium.strangedb.database.DatabaseCore;
import it.cavallium.strangedb.java.objects.EnhancedObject;
import it.cavallium.strangedb.java.database.IDatabaseTools;
import it.cavallium.strangedb.VariableWrapper;
@ -53,23 +52,23 @@ public class Performance {
testS("DatabaseCore root creation", 3000, Performance::regenDb, () -> db.loadRoot(PreloadedListContainer.class, PreloadedListContainer::new), () -> {});
final VariableWrapper<PreloadedListContainer> preloadedListContainer = new VariableWrapper<>(null);
final VariableWrapper<SimpleEnhancedObject> simpleEnhancedObjectContainer = new VariableWrapper<>(null);
testS("ObjectStrandeDbList<Int> creation", 3000, () -> {
testS("ObjectStrangeDbList<Int> creation", 3000, () -> {
regenDb();
preloadedListContainer.var = db.loadRoot(PreloadedListContainer.class, PreloadedListContainer::new);
}, () -> preloadedListContainer.var.list = new ObjectStrandeDbList<>(db), () -> {});
testS("ObjectStrandeDbList<Int>: Filling with 1000 items", 100, () -> {
}, () -> preloadedListContainer.var.list = new ObjectStrangeDbList<>(db), () -> {});
testS("ObjectStrangeDbList<Int>: Filling with 1000 items", 100, () -> {
regenDb();
preloadedListContainer.var = db.loadRoot(PreloadedListContainer.class, PreloadedListContainer::new);
preloadedListContainer.var.list = new ObjectStrandeDbList<>(db);
preloadedListContainer.var.list = new ObjectStrangeDbList<>(db);
}, () -> {
for (int i = 0; i < 1000; i++) {
preloadedListContainer.var.list.add(1000);
}
}, () -> {});
testS("ObjectStrandeDbList<EnhancedObject>: Filling with 1000 items", 100, () -> {
testS("ObjectStrangeDbList<EnhancedObject>: Filling with 1000 items", 100, () -> {
regenDb();
preloadedListContainer.var = db.loadRoot(PreloadedListContainer.class, PreloadedListContainer::new);
preloadedListContainer.var.listOfEnhancedObj = new EnhancedObjectStrandeDbList<>(db, SimpleEnhancedObject.class);
preloadedListContainer.var.listOfEnhancedObj = new EnhancedObjectStrangeDbList<>(db, SimpleEnhancedObject.class);
simpleEnhancedObjectContainer.var = new SimpleEnhancedObject(db);
simpleEnhancedObjectContainer.var.integerNumber = 10;
simpleEnhancedObjectContainer.var.longNumber = 10L;
@ -82,28 +81,28 @@ public class Performance {
preloadedListContainer.var.listOfEnhancedObj.add(simpleEnhancedObjectContainer.var);
}
}, () -> {});
testS("ObjectStrandeDbList<Int>: Filling with 10000 items", 10, () -> {
testS("ObjectStrangeDbList<Int>: Filling with 10000 items", 10, () -> {
regenDb();
preloadedListContainer.var = db.loadRoot(PreloadedListContainer.class, PreloadedListContainer::new);
preloadedListContainer.var.list = new ObjectStrandeDbList<>(db);
preloadedListContainer.var.list = new ObjectStrangeDbList<>(db);
}, () -> {
for (int i = 0; i < 10000; i++) {
preloadedListContainer.var.list.add(1000);
}
}, () -> {});
testS("ObjectStrandeDbList<Int>: Filling with 100000 items", 1, () -> {
testS("ObjectStrangeDbList<Int>: Filling with 100000 items", 1, () -> {
regenDb();
preloadedListContainer.var = db.loadRoot(PreloadedListContainer.class, PreloadedListContainer::new);
preloadedListContainer.var.list = new ObjectStrandeDbList<>(db);
preloadedListContainer.var.list = new ObjectStrangeDbList<>(db);
}, () -> {
for (int i = 0; i < 100000; i++) {
preloadedListContainer.var.list.add(1000);
}
}, () -> {});
testS("ObjectStrandeDbList<Int>: Loading 1000 items", 100, () -> {
testS("ObjectStrangeDbList<Int>: Loading 1000 items", 100, () -> {
regenDb();
preloadedListContainer.var = db.loadRoot(PreloadedListContainer.class, PreloadedListContainer::new);
preloadedListContainer.var.list = new ObjectStrandeDbList<>(db);
preloadedListContainer.var.list = new ObjectStrangeDbList<>(db);
for (int i = 0; i < 1000; i++) {
preloadedListContainer.var.list.add(1000);
}
@ -112,10 +111,10 @@ public class Performance {
preloadedListContainer.var.list.get(i);
}
}, () -> {});
testS("ObjectStrandeDbList<EnhancedObject>: Loading with 1000 items", 100, () -> {
testS("ObjectStrangeDbList<EnhancedObject>: Loading with 1000 items", 100, () -> {
regenDb();
preloadedListContainer.var = db.loadRoot(PreloadedListContainer.class, PreloadedListContainer::new);
preloadedListContainer.var.listOfEnhancedObj = new EnhancedObjectStrandeDbList<>(db, SimpleEnhancedObject.class);
preloadedListContainer.var.listOfEnhancedObj = new EnhancedObjectStrangeDbList<>(db, SimpleEnhancedObject.class);
simpleEnhancedObjectContainer.var = new SimpleEnhancedObject(db);
simpleEnhancedObjectContainer.var.integerNumber = 10;
simpleEnhancedObjectContainer.var.longNumber = 10L;
@ -131,10 +130,10 @@ public class Performance {
preloadedListContainer.var.listOfEnhancedObj.get(i);
}
}, () -> {});
testS("ObjectStrandeDbList<Int>: Loading 10000 items", 10, () -> {
testS("ObjectStrangeDbList<Int>: Loading 10000 items", 10, () -> {
regenDb();
preloadedListContainer.var = db.loadRoot(PreloadedListContainer.class, PreloadedListContainer::new);
preloadedListContainer.var.list = new ObjectStrandeDbList<>(db);
preloadedListContainer.var.list = new ObjectStrangeDbList<>(db);
for (int i = 0; i < 10000; i++) {
preloadedListContainer.var.list.add(1000);
}
@ -143,20 +142,20 @@ public class Performance {
preloadedListContainer.var.list.get(i);
}
}, () -> {});
testS("ObjectStrandeDbList<Int>: getLast() with 1000 items", 100, () -> {
testS("ObjectStrangeDbList<Int>: getLast() with 1000 items", 100, () -> {
regenDb();
preloadedListContainer.var = db.loadRoot(PreloadedListContainer.class, PreloadedListContainer::new);
preloadedListContainer.var.list = new ObjectStrandeDbList<>(db);
preloadedListContainer.var.list = new ObjectStrangeDbList<>(db);
for (int i = 0; i < 1000; i++) {
preloadedListContainer.var.list.add(1000);
}
}, () -> {
preloadedListContainer.var.list.getLast();
}, () -> {});
testS("ObjectStrandeDbList<EnhancedObject>: getLast() with 1000 items", 100, () -> {
testS("ObjectStrangeDbList<EnhancedObject>: getLast() with 1000 items", 100, () -> {
regenDb();
preloadedListContainer.var = db.loadRoot(PreloadedListContainer.class, PreloadedListContainer::new);
preloadedListContainer.var.listOfEnhancedObj = new EnhancedObjectStrandeDbList<>(db, SimpleEnhancedObject.class);
preloadedListContainer.var.listOfEnhancedObj = new EnhancedObjectStrangeDbList<>(db, SimpleEnhancedObject.class);
simpleEnhancedObjectContainer.var = new SimpleEnhancedObject(db);
simpleEnhancedObjectContainer.var.integerNumber = 10;
simpleEnhancedObjectContainer.var.longNumber = 10L;
@ -170,10 +169,10 @@ public class Performance {
}, () -> {
preloadedListContainer.var.listOfEnhancedObj.getLast();
}, () -> {});
testS("ObjectStrandeDbList<Int>: size() with 1000 items", 100, () -> {
testS("ObjectStrangeDbList<Int>: size() with 1000 items", 100, () -> {
regenDb();
preloadedListContainer.var = db.loadRoot(PreloadedListContainer.class, PreloadedListContainer::new);
preloadedListContainer.var.list = new ObjectStrandeDbList<>(db);
preloadedListContainer.var.list = new ObjectStrangeDbList<>(db);
for (int i = 0; i < 1000; i++) {
preloadedListContainer.var.list.add(1000);
}
@ -286,10 +285,10 @@ public class Performance {
public static class PreloadedListContainer extends EnhancedObject {
@DbField(id = 0, type = DbDataType.ENHANCED_OBJECT)
public ObjectStrandeDbList<Integer> list;
public ObjectStrangeDbList<Integer> list;
@DbField(id = 1, type = DbDataType.ENHANCED_OBJECT)
public EnhancedObjectStrandeDbList<SimpleEnhancedObject> listOfEnhancedObj;
public EnhancedObjectStrangeDbList<SimpleEnhancedObject> listOfEnhancedObj;
public PreloadedListContainer() {
@ -312,12 +311,12 @@ public class Performance {
@DbPropertyGetter(id = 0, type = DbDataType.ENHANCED_OBJECT)
public ObjectStrandeDbList<Integer> getList() {
public ObjectStrangeDbList<Integer> getList() {
return getProperty();
}
@DbPropertySetter(id = 1, type = DbDataType.ENHANCED_OBJECT)
public void setList(ObjectStrandeDbList<Integer> list) {
public void setList(ObjectStrangeDbList<Integer> list) {
setProperty(list);
}
}