* thread-safety details).
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public interface Column
{
* TableBuilder} for example usage.
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public class ColumnBuilder {
* thread-safety details).
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public interface Cursor extends Iterable<Row>
{
* </pre>
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public class CursorBuilder {
/** the table which the cursor will traverse */
* Supported access data types.
*
* @author Tim McCune
+ * @usage _general_class_
*/
public enum DataType {
* </pre>
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public class DatabaseBuilder
{
import java.util.List;
/**
+ * Access database index definition. A {@link Table} has a list of Index
+ * instances. Indexes can enable fast searches and ordered traversal on a
+ * Table (for the indexed columns). These features can be utilized via an
+ * {@link IndexCursor}.
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public interface Index
{
* TableBuilder} for example usage.
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public class IndexBuilder
{
* utilize the columns of the index will be fast.
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public interface IndexCursor extends Cursor
{
* Map of properties for a database object.
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public interface PropertyMap extends Iterable<PropertyMap.Property>
{
* Database}.
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public interface Relationship
{
* column names are case sensitive.
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public interface Row extends Map<String,Object>
{
* {@code toString()} methods.
*
* @author James Ahlborn
+ * @usage _intermediate_class_
*/
public interface RowId extends Comparable<RowId>
{
* Table interface (i.e. {@link #iterator} {@link #addRow}, {@link #updateRow}
* and {@link #deleteRow}), but for advanced search and data manipulation a
* {@link Cursor} instance should be used. New Tables can be created using a
- * {@link TableBuilder}.
+ * {@link TableBuilder}. The {@link com.healthmarketscience.jackcess.util.Joiner} utility can be used to traverse
+ * table relationships (e.g. find rows in another table based on a foreign-key
+ * relationship).
* <p/>
* A Table instance is not thread-safe (see {@link Database} for more
* thread-safety details).
* </pre>
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public class TableBuilder {
List<? extends Index.Column> toCols = joiner.getToIndex().getColumns();
Object[] toRow = new Object[joiner.getToTable().getColumnCount()];
- for(Iterator<Row> iter = joiner.findRows(
- oldFromRow, Collections.<String>emptySet()); iter.hasNext(); ) {
+ for(Iterator<Row> iter = joiner.findRows(oldFromRow)
+ .setColumnNames(Collections.<String>emptySet())
+ .iterator(); iter.hasNext(); ) {
iter.next();
// create update row for "to" table
* all other columns using simple equality.
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public class CaseInsensitiveColumnMatcher implements ColumnMatcher {
* Interface for handling comparisons between column values.
*
* @author James Ahlborn
+ * @usage _intermediate_class_
*/
public interface ColumnMatcher
{
package com.healthmarketscience.jackcess.util;
import java.io.IOException;
-import javax.xml.stream.Location;
import com.healthmarketscience.jackcess.Column;
import com.healthmarketscience.jackcess.impl.ByteUtil;
-import com.healthmarketscience.jackcess.util.ReplacementErrorHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
* value, see {@link ReplacementErrorHandler}.
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public class DebugErrorHandler extends ReplacementErrorHandler
{
import com.healthmarketscience.jackcess.impl.IndexCursorImpl;
/**
- * Builder style class for constructing an IndexCursor entry
+ * Builder style class for constructing an {@link IndexCursor} entry
* Iterable/Iterator.
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public class EntryIterableBuilder implements Iterable<Row>
{
* encountered.
*
* @author James Ahlborn
+ * @usage _intermediate_class_
*/
public interface ErrorHandler
{
/**
* Interface which allows customization of the behavior of the
- * <code>Database</code> export methods.
+ * {@link ExportUtil} export methods.
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public interface ExportFilter {
import org.apache.commons.logging.LogFactory;
/**
+ * Utility class for exporting tables from an Access database to other
+ * formats. See the {@link Builder} for convenient configuration of the
+ * export functionality. Note that most scenarios for customizing output data
+ * can be handled by implementing a custom {@link ExportFilter}.
*
* @author Frank Gerbig
+ * @usage _general_class_
*/
public class ExportUtil {
/**
* Interface which allows customization of the behavior of the
- * <code>Database</code> import/copy methods.
+ * {@link ImportUtil} import methods.
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public interface ImportFilter {
import org.apache.commons.logging.LogFactory;
/**
+ * Utility class for importing tables to an Access database from other
+ * sources. See the {@link Builder} for convenient configuration of the
+ * import functionality. Note that most scenarios for customizing input data
+ * can be handled by implementing a custom {@link ImportFilter}.
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public class ImportUtil
{
import com.healthmarketscience.jackcess.impl.CursorImpl;
/**
- * Builder style class for constructing a Cursor Iterable/Iterator.
+ * Builder style class for constructing a {@link Cursor} Iterable/Iterator.
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public class IterableBuilder implements Iterable<Row>
{
import com.healthmarketscience.jackcess.Index;
import com.healthmarketscience.jackcess.IndexCursor;
import com.healthmarketscience.jackcess.Row;
-import com.healthmarketscience.jackcess.RuntimeIOException;
import com.healthmarketscience.jackcess.Table;
import com.healthmarketscience.jackcess.impl.IndexImpl;
* relationships.
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public class Joiner
{
* columns for this join relationship)
* @param columnNames desired columns in the from table row
*/
- public Row findFirstRow(Map<String,?> fromRow,
- Collection<String> columnNames)
+ public Row findFirstRow(Map<String,?> fromRow, Collection<String> columnNames)
throws IOException
{
return (hasRows(fromRow) ? _toCursor.getCurrentRow(columnNames) : null);
* @param fromRow row from the "from" table (which must include the relevant
* columns for this join relationship)
*/
- public Iterator<Row> findRows(Map<String,?> fromRow)
- {
- return findRows(fromRow, null);
- }
-
- /**
- * Returns an Iterator with the selected columns over all the rows in the
- * "to" table based on the given columns in the "from" table.
- *
- * @param fromRow row from the "from" table (which must include the relevant
- * columns for this join relationship)
- * @param columnNames desired columns in the from table row
- */
- public Iterator<Row> findRows(Map<String,?> fromRow,
- Collection<String> columnNames)
+ public EntryIterableBuilder findRows(Map<String,?> fromRow)
{
toEntryValues(fromRow);
- return _toCursor.newEntryIterable(_entryValues)
- .setColumnNames(columnNames).iterator();
+ return _toCursor.newEntryIterable(_entryValues);
}
-
+
/**
* Returns an Iterator with the selected columns over all the rows in the
* "to" table based on the given columns in the "from" table.
*
* @param fromRow row from the "from" table (which must include the relevant
* columns for this join relationship)
- * @param columnNames desired columns in the from table row
- * @usage _intermediate_method_
*/
- public Iterator<Row> findRows(Object[] fromRow,
- Collection<String> columnNames)
+ public EntryIterableBuilder findRows(Object[] fromRow)
{
toEntryValues(fromRow);
- return _toCursor.newEntryIterable(_entryValues)
- .setColumnNames(columnNames).iterator();
- }
-
- /**
- * Returns an Iterable whose iterator() method returns the result of a call
- * to {@link #findRows(Map)}
- *
- * @param fromRow row from the "from" table (which must include the relevant
- * columns for this join relationship)
- * @throws RuntimeIOException if an IOException is thrown by one of the
- * operations, the actual exception will be contained within
- */
- public Iterable<Row> findRowsIterable(Map<String,?> fromRow)
- {
- return findRowsIterable(fromRow, null);
- }
-
- /**
- * Returns an Iterable whose iterator() method returns the result of a call
- * to {@link #findRows(Map,Collection)}
- *
- * @param fromRow row from the "from" table (which must include the relevant
- * columns for this join relationship)
- * @param columnNames desired columns in the from table row
- * @throws RuntimeIOException if an IOException is thrown by one of the
- * operations, the actual exception will be contained within
- */
- public Iterable<Row> findRowsIterable(
- final Map<String,?> fromRow, final Collection<String> columnNames)
- {
- return new Iterable<Row>() {
- public Iterator<Row> iterator() {
- return findRows(fromRow, columnNames);
- }
- };
+ return _toCursor.newEntryIterable(_entryValues);
}
/**
* otherwise
*/
public boolean deleteRows(Map<String,?> fromRow) throws IOException {
- return deleteRowsImpl(findRows(fromRow, Collections.<String>emptySet()));
+ return deleteRowsImpl(findRows(fromRow)
+ .setColumnNames(Collections.<String>emptySet())
+ .iterator());
}
/**
* @usage _intermediate_method_
*/
public boolean deleteRows(Object[] fromRow) throws IOException {
- return deleteRowsImpl(findRows(fromRow, Collections.<String>emptySet()));
+ return deleteRowsImpl(findRows(fromRow)
+ .setColumnNames(Collections.<String>emptySet())
+ .iterator());
}
/**
* Resolver for linked databases.
*
* @author James Ahlborn
+ * @usage _intermediate_class_
*/
public interface LinkResolver
{
package com.healthmarketscience.jackcess.util;
import java.io.IOException;
-import javax.xml.stream.Location;
import com.healthmarketscience.jackcess.Column;
/**
* configured object.
*
* @author James Ahlborn
+ * @usage _intermediate_class_
*/
public class ReplacementErrorHandler implements ErrorHandler
{
* table which returns only rows matching some criteria.
*
* @author Patricia Donaldson, Xerox Corporation
+ * @usage _general_class_
*/
public abstract class RowFilter
{
* Simple concrete implementation of ColumnMatcher which test for equality.
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public class SimpleColumnMatcher implements ColumnMatcher {
* values.
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public class SimpleExportFilter implements ExportFilter {
* values.
*
* @author James Ahlborn
+ * @usage _general_class_
*/
public class SimpleImportFilter implements ImportFilter {
t = (TableImpl)db.getTable("Table1");
index = t.getIndexes().get(0);
- System.out.println("IndexTest: Index type: " +
- index.getIndexData().getClass());
t.addRow(99, "abc", "def");
}
}
List<Row> joinedRows =
new ArrayList<Row>();
- for(Row t1Row : join.findRowsIterable(row)) {
+ for(Row t1Row : join.findRows(row)) {
joinedRows.add(t1Row);
}
}
joinedRows = new ArrayList<Row>();
- for(Row t1Row : join.findRowsIterable(row, colNames)) {
+ for(Row t1Row : join.findRows(row).setColumnNames(colNames)) {
joinedRows.add(t1Row);
}