Skip to content

Commit

Permalink
Merge pull request #137 from mekjaer/develop
Browse files Browse the repository at this point in the history
Benchmark case updated with moved setIndex. Float and Double column search fixed in typed. Pom file now has modules again
  • Loading branch information
mekjaer committed Sep 25, 2013
2 parents cb42f70 + 211a432 commit 5605f28
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public static void main(String[] args) {


// Add an index and lets try some lookups
table.setIndex(0); // syntax will soon be "table.name.setIndex();"
table.name.setIndex();
timer.Start();
long tightdbLookups = 0;
int randLength = randomNames.length;
Expand Down
20 changes: 14 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>com.tightdb</groupId>
<artifactId>tightdb</artifactId>
<version>0.0.1</version>
<packaging>pom</packaging>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.testng</groupId>
Expand All @@ -21,7 +21,7 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
Expand All @@ -33,5 +33,13 @@
</configuration>
</plugin>
</plugins>
</build>
</build>
<modules>
<module>tightdb-java-core</module>
<module>tightdb-java-generator</module>
<module>tightdb-java-example</module>
<module>tightdb-java-doc</module>
<module>tightdb-java-test</module>
</modules>
</project>

Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ public void setAll(double value) {
// tableOrView.addDouble(columnIndex, value);
// }

public Cursor findFirst(long value) {
public Cursor findFirst(double value) {
return cursor(tableOrView.findFirstDouble(columnIndex, value));
}

public View findAll(long value) {
public View findAll(double value) {
return view(tableOrView.findAllDouble(columnIndex, value));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ public void setAll(float value) {
// tableOrView.addFloat(columnIndex, value);
// }

public Cursor findFirst(long value) {
public Cursor findFirst(float value) {
return cursor(tableOrView.findFirstFloat(columnIndex, value));
}

public View findAll(long value) {
public View findAll(float value) {
return view(tableOrView.findAllFloat(columnIndex, value));
}

Expand Down
11 changes: 11 additions & 0 deletions tightdb-java-test/src/test/java/com/tightdb/typed/NumbersTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,17 @@ public void shouldAggregateDoublesOnView() {
assertEquals(30000.6d, view.doubleNum.maximum());
assertEquals(50000.8d, view.doubleNum.sum(), 0.01);
assertEquals(50000.8d/3, view.doubleNum.average(), 0.01);

}


@Test
public void searchValuesOnView() {
assertEquals(2 , view.doubleNum.findAll(10000.1d).size() );
assertEquals(2 , view.floatNum.findAll(10000.1f).size() );

assertEquals(1 , view.doubleNum.findFirst(30000.6d).getPosition());
assertEquals(1 , view.floatNum.findFirst(30000.6f).getPosition() );
}


Expand Down

0 comments on commit 5605f28

Please sign in to comment.