You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by ml...@apache.org on 2014/12/22 16:53:56 UTC
svn commit: r1647336 - in
/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis:
internal/shapefile/jdbc/resultset/ storage/shapefile/
Author: mlebihan
Date: Mon Dec 22 15:53:55 2014
New Revision: 1647336
URL: http://svn.apache.org/r1647336
Log:
SIS-185 :
- getRecordCount() changed to getRowCount().
- Method return HashMap in database now returns a Map.
Modified:
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/AbstractByteReader.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ByteReader.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/Database.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/MappedByteReader.java
sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapeFile.java
Modified: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.java?rev=1647336&r1=1647335&r2=1647336&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.java [UTF-8] Mon Dec 22 15:53:55 2014
@@ -393,7 +393,7 @@ public class DBFRecordBasedResultSet ext
assertNotClosed();
// Check that we aren't at the end of the Database file.
- final int remaining = getDatabase().getRecordCount() - getDatabase().getRowNum();
+ final int remaining = getDatabase().getRowCount() - getDatabase().getRowNum();
if (remaining <= 0) {
throw new SQLNoResultException(format(Level.SEVERE, "excp.no_more_results", m_sql, getDatabase().getFile().getName()), m_sql, getDatabase().getFile());
@@ -417,13 +417,13 @@ public class DBFRecordBasedResultSet ext
private boolean nextRecordMatchingConditions() throws SQLInvalidStatementException, SQLIllegalParameterException, SQLNoSuchFieldException, SQLUnsupportedParsingFeatureException, SQLConnectionClosedException, SQLNotNumericException, SQLNotDateException {
boolean recordMatchesConditions = false;
- while(getDatabase().getRecordCount() - getDatabase().getRowNum() > 0 && recordMatchesConditions == false) {
+ while(getDatabase().getRowCount() - getDatabase().getRowNum() > 0 && recordMatchesConditions == false) {
m_record = getDatabase().readNextRowAsObjects();
recordMatchesConditions = m_singleConditionOfWhereClause == null || m_singleConditionOfWhereClause.isVerified(this);
}
return recordMatchesConditions &&
- (getDatabase().getRecordCount() - getDatabase().getRowNum() > 0); // Beware of the end of database !
+ (getDatabase().getRowCount() - getDatabase().getRowNum() > 0); // Beware of the end of database !
}
/**
Modified: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/AbstractByteReader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/AbstractByteReader.java?rev=1647336&r1=1647335&r2=1647336&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/AbstractByteReader.java (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/AbstractByteReader.java Mon Dec 22 15:53:55 2014
@@ -80,7 +80,7 @@ abstract class AbstractByteReader extend
protected byte dbaseVersion;
/** Number of records in the table. */
- protected int recordCount;
+ protected int rowCount;
/** Database charset. */
protected Charset charset;
@@ -122,8 +122,8 @@ abstract class AbstractByteReader extend
* Returns the record count.
* @return Record count.
*/
- @Override public int getRecordCount() {
- return recordCount;
+ @Override public int getRowCount() {
+ return rowCount;
}
/**
Modified: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ByteReader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ByteReader.java?rev=1647336&r1=1647335&r2=1647336&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ByteReader.java (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ByteReader.java Mon Dec 22 15:53:55 2014
@@ -56,7 +56,7 @@ interface ByteReader {
* Returns the record count.
* @return Record count.
*/
- public int getRecordCount();
+ public int getRowCount();
/**
* Returns the current record number.
Modified: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/Database.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/Database.java?rev=1647336&r1=1647335&r2=1647336&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/Database.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/Database.java [UTF-8] Mon Dec 22 15:53:55 2014
@@ -20,8 +20,8 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.charset.Charset;
-import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Objects;
import org.apache.sis.util.logging.AbstractAutoChecker;
@@ -81,11 +81,11 @@ public class Database extends AbstractAu
}
/**
- * Return the record count of the database file.
- * @return Record count.
+ * Return the row count of the database file.
+ * @return row count.
*/
- public int getRecordCount() {
- return binaryReader.getRecordCount();
+ public int getRowCount() {
+ return binaryReader.getRowCount();
}
/**
@@ -138,7 +138,7 @@ public class Database extends AbstractAu
* @deprecated Will be removed in next API versions.
*/
@Deprecated
- public HashMap<String, Object> readNextRowAsObjects() {
+ public Map<String, Object> readNextRowAsObjects() {
return binaryReader.readNextRowAsObjects();
}
Modified: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/MappedByteReader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/MappedByteReader.java?rev=1647336&r1=1647335&r2=1647336&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/MappedByteReader.java (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/MappedByteReader.java Mon Dec 22 15:53:55 2014
@@ -133,7 +133,7 @@ class MappedByteReader extends AbstractB
df.get(this.dbaseLastUpdate);
df.order(ByteOrder.LITTLE_ENDIAN);
- this.recordCount = df.getInt();
+ this.rowCount = df.getInt();
this.dbaseHeaderBytes = df.getShort();
this.dbaseRecordBytes = df.getShort();
df.order(ByteOrder.BIG_ENDIAN);
Modified: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapeFile.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapeFile.java?rev=1647336&r1=1647335&r2=1647336&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapeFile.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapeFile.java [UTF-8] Mon Dec 22 15:53:55 2014
@@ -164,7 +164,7 @@ public class ShapeFile {
* @return Feature count.
*/
public int getFeatureCount() {
- return this.dbf.getRecordCount();
+ return this.dbf.getRowCount();
}
/**
@@ -182,7 +182,7 @@ public class ShapeFile {
* @throws DataStoreException if a validation problem occurs.
*/
private void loadFeatures(DefaultFeatureType featureType, MappedByteBuffer rf) throws DataStoreException {
- for (Integer i = 0; i < this.dbf.getRecordCount(); i++) {
+ for (Integer i = 0; i < this.dbf.getRowCount(); i++) {
// insert points into some type of list
int RecordNumber = rf.getInt();
@SuppressWarnings("unused")