Skip to content

Commit

Permalink
Formatting of method signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
spannm committed Mar 8, 2024
1 parent e1050e5 commit 9224bf8
Show file tree
Hide file tree
Showing 57 changed files with 292 additions and 580 deletions.
9 changes: 3 additions & 6 deletions src/main/java/io/github/spannm/jackcess/ColumnBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,15 @@ public ColumnBuilder withSqlType(int type) throws IOException {
/**
* Sets the type for the new column based on the given SQL type and target data length (in type specific units).
*/
public ColumnBuilder withSqlType(int type, int lengthInUnits)
throws IOException {
public ColumnBuilder withSqlType(int type, int lengthInUnits) throws IOException {
return withSqlType(type, lengthInUnits, null);
}

/**
* Sets the type for the new column based on the given SQL type, target data length (in type specific units), and
* target FileFormat.
*/
public ColumnBuilder withSqlType(int type, int lengthInUnits, FileFormat fileFormat)
throws IOException {
public ColumnBuilder withSqlType(int type, int lengthInUnits, FileFormat fileFormat) throws IOException {
return withType(DataType.fromSQLType(type, lengthInUnits, fileFormat));
}

Expand Down Expand Up @@ -282,8 +280,7 @@ private PropertyMap.Property getProperty(String name) {
/**
* Sets all attributes except name from the given Column template (including all column properties except GUID).
*/
public ColumnBuilder withFromColumn(Column template)
throws IOException {
public ColumnBuilder withFromColumn(Column template) throws IOException {
DataType type = template.getType();
withType(type);
withLength(template.getLength());
Expand Down
27 changes: 9 additions & 18 deletions src/main/java/io/github/spannm/jackcess/Cursor.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ public interface Cursor extends Iterable<Row> {
*
* @throws IllegalArgumentException if the given savepoint does not have a cursorId equal to this cursor's id
*/
void restoreSavepoint(Savepoint savepoint)
throws IOException;
void restoreSavepoint(Savepoint savepoint) throws IOException;

/**
* Resets this cursor for forward traversal. Calls {@link #beforeFirst}.
Expand Down Expand Up @@ -166,8 +165,7 @@ default Stream<Row> stream() {
* @return the given row, updated with the current row values
* @throws IllegalStateException if the current row is not valid (at beginning or end of table), or deleted.
*/
<M extends Map<String, Object>> M updateCurrentRowFromMap(M row)
throws IOException;
<M extends Map<String, Object>> M updateCurrentRowFromMap(M row) throws IOException;

/**
* Moves to the next row in the table and returns it.
Expand All @@ -182,8 +180,7 @@ <M extends Map<String, Object>> M updateCurrentRowFromMap(M row)
* @param columnNames Only column names in this collection will be returned
* @return The next row in this table (Column name -&gt; Column value), or {@code null} if no next row is found
*/
Row getNextRow(Collection<String> columnNames)
throws IOException;
Row getNextRow(Collection<String> columnNames) throws IOException;

/**
* Moves to the previous row in the table and returns it.
Expand All @@ -200,8 +197,7 @@ Row getNextRow(Collection<String> columnNames)
* @return The previous row in this table (Column name -&gt; Column value), or {@code null} if no previous row is
* found
*/
Row getPreviousRow(Collection<String> columnNames)
throws IOException;
Row getPreviousRow(Collection<String> columnNames) throws IOException;

/**
* Moves to the next row as defined by this cursor.
Expand Down Expand Up @@ -239,8 +235,7 @@ Row getPreviousRow(Collection<String> columnNames)
* instead (overriding any configured ColumnMatcher)
* @return {@code true} if a valid row was found with the given value, {@code false} if no row was found
*/
boolean findFirstRow(Column columnPattern, Object valuePattern)
throws IOException;
boolean findFirstRow(Column columnPattern, Object valuePattern) throws IOException;

/**
* Moves to the next row (as defined by the cursor) where the given column has the given value. This may be more
Expand All @@ -253,8 +248,7 @@ boolean findFirstRow(Column columnPattern, Object valuePattern)
* instead (overriding any configured ColumnMatcher)
* @return {@code true} if a valid row was found with the given value, {@code false} if no row was found
*/
boolean findNextRow(Column columnPattern, Object valuePattern)
throws IOException;
boolean findNextRow(Column columnPattern, Object valuePattern) throws IOException;

/**
* Moves to the first row (as defined by the cursor) where the given columns have the given values. This may be more
Expand Down Expand Up @@ -291,8 +285,7 @@ boolean findNextRow(Column columnPattern, Object valuePattern)
* instance of {@link java.util.function.Predicate}, it will be applied to the potential row value
* instead (overriding any configured ColumnMatcher)
*/
boolean currentRowMatches(Column columnPattern, Object valuePattern)
throws IOException;
boolean currentRowMatches(Column columnPattern, Object valuePattern) throws IOException;

/**
* Returns {@code true} if the current row matches the given pattern.
Expand Down Expand Up @@ -327,8 +320,7 @@ boolean currentRowMatches(Column columnPattern, Object valuePattern)
*
* @param columnNames Only column names in this collection will be returned
*/
Row getCurrentRow(Collection<String> columnNames)
throws IOException;
Row getCurrentRow(Collection<String> columnNames) throws IOException;

/**
* Returns the given column from the current row.
Expand All @@ -340,8 +332,7 @@ Row getCurrentRow(Collection<String> columnNames)
*
* @throws IllegalStateException if the current row is not valid (at beginning or end of table), or deleted.
*/
void setCurrentRowValue(Column column, Object value)
throws IOException;
void setCurrentRowValue(Column column, Object value) throws IOException;

/**
* Identifier for a cursor. Will be equal to any other cursor of the same type for the same table. Primarily used to
Expand Down
30 changes: 10 additions & 20 deletions src/main/java/io/github/spannm/jackcess/CursorBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,7 @@ public static Cursor createCursor(Table table) throws IOException {
*
* @param index index for the table which will define traversal order as well as enhance certain lookups
*/
public static IndexCursor createCursor(Index index)
throws IOException {
public static IndexCursor createCursor(Index index) throws IOException {
return index.getTable().newCursor().withIndex(index).toIndexCursor();
}

Expand All @@ -304,8 +303,7 @@ public static IndexCursor createCursor(Index index)
*
* @param table the table over which this cursor will traverse
*/
public static IndexCursor createPrimaryKeyCursor(Table table)
throws IOException {
public static IndexCursor createPrimaryKeyCursor(Table table) throws IOException {
return createCursor(table.getPrimaryKeyIndex());
}

Expand All @@ -320,8 +318,7 @@ public static IndexCursor createPrimaryKeyCursor(Table table)
* @param endRow the last row of data for the cursor (inclusive), or {@code null} for the last entry
*/
public static IndexCursor createCursor(Index index,
Object[] startRow, Object[] endRow)
throws IOException {
Object[] startRow, Object[] endRow) throws IOException {
return index.getTable().newCursor().withIndex(index)
.withStartRow(startRow)
.withEndRow(endRow)
Expand All @@ -344,8 +341,7 @@ public static IndexCursor createCursor(Index index,
Object[] startRow,
boolean startInclusive,
Object[] endRow,
boolean endInclusive)
throws IOException {
boolean endInclusive) throws IOException {
return index.getTable().newCursor().withIndex(index)
.withStartRow(startRow)
.withStartRowInclusive(startInclusive)
Expand All @@ -365,8 +361,7 @@ public static IndexCursor createCursor(Index index,
* @param rowPattern pattern to be used to find the row
* @return the matching row or {@code null} if a match could not be found.
*/
public static Row findRow(Table table, Map<String, ?> rowPattern)
throws IOException {
public static Row findRow(Table table, Map<String, ?> rowPattern) throws IOException {
Cursor cursor = createCursor(table);
if (cursor.findFirstRow(rowPattern)) {
return cursor.getCurrentRow();
Expand All @@ -382,8 +377,7 @@ public static Row findRow(Table table, Map<String, ?> rowPattern)
* @param entryValues the column values for the index's columns.
* @return the matching row or {@code null} if a match could not be found.
*/
public static Row findRowByEntry(Index index, Object... entryValues)
throws IOException {
public static Row findRowByEntry(Index index, Object... entryValues) throws IOException {
return createCursor(index).findRowByEntry(entryValues);
}

Expand All @@ -395,8 +389,7 @@ public static Row findRowByEntry(Index index, Object... entryValues)
* @param entryValues the column values for the table's primary key columns.
* @return the matching row or {@code null} if a match could not be found.
*/
public static Row findRowByPrimaryKey(Table table, Object... entryValues)
throws IOException {
public static Row findRowByPrimaryKey(Table table, Object... entryValues) throws IOException {
return findRowByEntry(table.getPrimaryKeyIndex(), entryValues);
}

Expand All @@ -415,8 +408,7 @@ public static Row findRowByPrimaryKey(Table table, Object... entryValues)
* @return the matching row or {@code null} if a match could not be found.
*/
public static Object findValue(Table table, Column column,
Column columnPattern, Object valuePattern)
throws IOException {
Column columnPattern, Object valuePattern) throws IOException {
Cursor cursor = createCursor(table);
if (cursor.findFirstRow(columnPattern, valuePattern)) {
return cursor.getCurrentRowValue(column);
Expand All @@ -435,8 +427,7 @@ public static Object findValue(Table table, Column column,
* @param rowPattern pattern to be used to find the row
* @return the matching row or {@code null} if a match could not be found.
*/
public static Row findRow(Index index, Map<String, ?> rowPattern)
throws IOException {
public static Row findRow(Index index, Map<String, ?> rowPattern) throws IOException {
Cursor cursor = createCursor(index);
if (cursor.findFirstRow(rowPattern)) {
return cursor.getCurrentRow();
Expand All @@ -459,8 +450,7 @@ public static Row findRow(Index index, Map<String, ?> rowPattern)
* @return the matching row or {@code null} if a match could not be found.
*/
public static Object findValue(Index index, Column column,
Column columnPattern, Object valuePattern)
throws IOException {
Column columnPattern, Object valuePattern) throws IOException {
Cursor cursor = createCursor(index);
if (cursor.findFirstRow(columnPattern, valuePattern)) {
return cursor.getCurrentRowValue(column);
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/io/github/spannm/jackcess/DataType.java
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,7 @@ public static DataType fromSQLType(int sqlType, int lengthInUnits) throws IOExce
return fromSQLType(sqlType, lengthInUnits, null);
}

public static DataType fromSQLType(int sqlType, int lengthInUnits, FileFormat fileFormat)
throws IOException {
public static DataType fromSQLType(int sqlType, int lengthInUnits, FileFormat fileFormat) throws IOException {
DataType[] rtnArr = SQL_TYPES.get(sqlType);
if (rtnArr == null) {
throw new JackcessException("Unsupported SQL type: " + sqlType);
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/io/github/spannm/jackcess/DatabaseBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,7 @@ public static Database open(Path mdbFile) throws IOException {
*
* @see DatabaseBuilder for more flexible Database creation
*/
public static Database create(FileFormat fileFormat, File mdbFile)
throws IOException {
public static Database create(FileFormat fileFormat, File mdbFile) throws IOException {
return new DatabaseBuilder(mdbFile).withFileFormat(fileFormat).create();
}

Expand Down
12 changes: 4 additions & 8 deletions src/main/java/io/github/spannm/jackcess/IndexCursor.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ public interface IndexCursor extends Cursor {
* @param entryValues the column values for the index's columns.
* @return the matching row or {@code null} if a match could not be found.
*/
Row findRowByEntry(Object... entryValues)
throws IOException;
Row findRowByEntry(Object... entryValues) throws IOException;

/**
* Moves to the first row (as defined by the cursor) where the index entries match the given values. If a match is
Expand All @@ -50,25 +49,22 @@ Row findRowByEntry(Object... entryValues)
* @param entryValues the column values for the index's columns.
* @return {@code true} if a valid row was found with the given values, {@code false} if no row was found
*/
boolean findFirstRowByEntry(Object... entryValues)
throws IOException;
boolean findFirstRowByEntry(Object... entryValues) throws IOException;

/**
* Moves to the first row (as defined by the cursor) where the index entries are &gt;= the given values. If a an
* exception is thrown, the cursor is restored to its previous state.
*
* @param entryValues the column values for the index's columns.
*/
void findClosestRowByEntry(Object... entryValues)
throws IOException;
void findClosestRowByEntry(Object... entryValues) throws IOException;

/**
* Returns {@code true} if the current row matches the given index entries.
*
* @param entryValues the column values for the index's columns.
*/
boolean currentRowMatchesEntry(Object... entryValues)
throws IOException;
boolean currentRowMatchesEntry(Object... entryValues) throws IOException;

/**
* Convenience method for constructing a new EntryIterableBuilder for this cursor. An EntryIterableBuilder provides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ public String getName() {
/**
* Creates a new Relationship in the given Database with the currently configured attributes.
*/
public Relationship toRelationship(Database db)
throws IOException {
public Relationship toRelationship(Database db) throws IOException {
return new RelationshipCreator((DatabaseImpl) db).createRelationship(this);
}

Expand Down
9 changes: 3 additions & 6 deletions src/main/java/io/github/spannm/jackcess/Table.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ enum ColumnOrder {
*
* @return the given row map, which will contain any autonumbers generated
*/
<M extends Map<String, Object>> M addRowFromMap(M row)
throws IOException;
<M extends Map<String, Object>> M addRowFromMap(M row) throws IOException;

/**
* Add multiple rows to this table, only writing to disk after all rows have been written, and every time a data
Expand All @@ -221,8 +220,7 @@ <M extends Map<String, Object>> M addRowFromMap(M row)
* @return the given row values list (unless row values were to small), with appropriately sized row values (the
* ones passed in if long enough). the returned arrays will contain any autonumbers generated
*/
List<? extends Object[]> addRows(List<? extends Object[]> rows)
throws IOException;
List<? extends Object[]> addRows(List<? extends Object[]> rows) throws IOException;

/**
* Calls {@link #asRow} on the given row maps and passes the results to {@link #addRows}.
Expand All @@ -235,8 +233,7 @@ List<? extends Object[]> addRows(List<? extends Object[]> rows)
*
* @return the given row map list, where the row maps will contain any autonumbers generated
*/
<M extends Map<String, Object>> List<M> addRowsFromMaps(List<M> rows)
throws IOException;
<M extends Map<String, Object>> List<M> addRowsFromMaps(List<M> rows) throws IOException;

/**
* Update the given row. Provided Row must have previously been returned from this Table.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,14 @@ public interface ComplexColumnInfo<V extends ComplexValue> {

int countValues(int complexValueFk) throws IOException;

List<Row> getRawValues(int complexValueFk)
throws IOException;
List<Row> getRawValues(int complexValueFk) throws IOException;

List<Row> getRawValues(int complexValueFk,
Collection<String> columnNames)
throws IOException;
Collection<String> columnNames) throws IOException;

List<V> getValues(ComplexValueForeignKey complexValueFk)
throws IOException;
List<V> getValues(ComplexValueForeignKey complexValueFk) throws IOException;

ComplexValue.Id addRawValue(Map<String, ?> rawValue)
throws IOException;
ComplexValue.Id addRawValue(Map<String, ?> rawValue) throws IOException;

ComplexValue.Id addValue(V value) throws IOException;

Expand All @@ -64,7 +60,6 @@ ComplexValue.Id addRawValue(Map<String, ?> rawValue)

void deleteAllValues(int complexValueFk) throws IOException;

void deleteAllValues(ComplexValueForeignKey complexValueFk)
throws IOException;
void deleteAllValues(ComplexValueForeignKey complexValueFk) throws IOException;

}
Loading

0 comments on commit 9224bf8

Please sign in to comment.