diff options
61 files changed, 481 insertions, 1 deletions
diff --git a/src/main/java/com/healthmarketscience/jackcess/Cursor.java b/src/main/java/com/healthmarketscience/jackcess/Cursor.java index c556072..2d0c9f7 100644 --- a/src/main/java/com/healthmarketscience/jackcess/Cursor.java +++ b/src/main/java/com/healthmarketscience/jackcess/Cursor.java @@ -140,6 +140,7 @@ public interface Cursor extends Iterable<Row> * @throws RuntimeIOException if an IOException is thrown by one of the * operations, the actual exception will be contained within */ + @Override public Iterator<Row> iterator(); /** diff --git a/src/main/java/com/healthmarketscience/jackcess/PropertyMap.java b/src/main/java/com/healthmarketscience/jackcess/PropertyMap.java index 7205094..7ff920b 100644 --- a/src/main/java/com/healthmarketscience/jackcess/PropertyMap.java +++ b/src/main/java/com/healthmarketscience/jackcess/PropertyMap.java @@ -204,6 +204,7 @@ public interface PropertyMap extends Iterable<PropertyMap.Property> _value = (short)value; } + @Override public Short getValue() { return _value; } @@ -228,6 +229,7 @@ public interface PropertyMap extends Iterable<PropertyMap.Property> _value = (byte)value; } + @Override public Byte getValue() { return _value; } @@ -261,6 +263,7 @@ public interface PropertyMap extends Iterable<PropertyMap.Property> _value = (byte)value; } + @Override public Byte getValue() { return _value; } @@ -287,6 +290,7 @@ public interface PropertyMap extends Iterable<PropertyMap.Property> _value = (byte)value; } + @Override public Byte getValue() { return _value; } diff --git a/src/main/java/com/healthmarketscience/jackcess/Table.java b/src/main/java/com/healthmarketscience/jackcess/Table.java index 53b979b..c1d1ddd 100644 --- a/src/main/java/com/healthmarketscience/jackcess/Table.java +++ b/src/main/java/com/healthmarketscience/jackcess/Table.java @@ -285,6 +285,7 @@ public interface Table extends Iterable<Row> * operations, the actual exception will be contained within * @usage _general_method_ */ + @Override public Iterator<Row> iterator(); /** diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/BaseEvalContext.java b/src/main/java/com/healthmarketscience/jackcess/impl/BaseEvalContext.java index 28785d1..36b32d8 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/BaseEvalContext.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/BaseEvalContext.java @@ -80,50 +80,62 @@ public abstract class BaseEvalContext implements EvalContext return _dbCtx.getDatabase(); } + @Override public TemporalConfig getTemporalConfig() { return _dbCtx.getTemporalConfig(); } + @Override public DateTimeFormatter createDateFormatter(String formatStr) { return _dbCtx.createDateFormatter(formatStr); } + @Override public ZoneId getZoneId() { return _dbCtx.getZoneId(); } + @Override public NumericConfig getNumericConfig() { return _dbCtx.getNumericConfig(); } + @Override public DecimalFormat createDecimalFormat(String formatStr) { return _dbCtx.createDecimalFormat(formatStr); } + @Override public float getRandom(Integer seed) { return _dbCtx.getRandom(seed); } + @Override public Value.Type getResultType() { return null; } + @Override public Value getThisColumnValue() { throw new UnsupportedOperationException(); } + @Override public Value getIdentifierValue(Identifier identifier) { throw new UnsupportedOperationException(); } + @Override public Bindings getBindings() { return _dbCtx.getBindings(); } + @Override public Object get(String key) { return _dbCtx.getBindings().get(key); } + @Override public void put(String key, Object value) { _dbCtx.getBindings().put(key, value); } @@ -208,26 +220,32 @@ public abstract class BaseEvalContext implements EvalContext return expr; } + @Override public Object eval(EvalContext ctx) { return getExpr().eval(ctx); } + @Override public String toDebugString(LocaleContext ctx) { return getExpr().toDebugString(ctx); } + @Override public String toRawString() { return _exprStr; } + @Override public String toCleanString(LocaleContext ctx) { return getExpr().toCleanString(ctx); } + @Override public boolean isConstant() { return getExpr().isConstant(); } + @Override public void collectIdentifiers(Collection<Identifier> identifiers) { getExpr().collectIdentifiers(identifiers); } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/CompoundOleUtil.java b/src/main/java/com/healthmarketscience/jackcess/impl/CompoundOleUtil.java index 1ee3860..897a195 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/CompoundOleUtil.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/CompoundOleUtil.java @@ -67,6 +67,7 @@ public class CompoundOleUtil implements CompoundPackageFactory /** * Creates a nes CompoundContent for the given blob information. */ + @Override public ContentImpl createCompoundPackageContent( OleBlobImpl blob, String prettyName, String className, String typeName, ByteBuffer blobBb, int dataBlockLen) @@ -148,6 +149,7 @@ public class CompoundOleUtil implements CompoundPackageFactory super(blob, prettyName, className, typeName, position, length); } + @Override public ContentType getType() { return ContentType.COMPOUND_STORAGE; } @@ -159,6 +161,7 @@ public class CompoundOleUtil implements CompoundPackageFactory return _fs; } + @Override public Iterator<Entry> iterator() { try { return getEntries(new ArrayList<Entry>(), getFileSystem().getRoot(), @@ -168,15 +171,18 @@ public class CompoundOleUtil implements CompoundPackageFactory } } + @Override public EntryImpl getEntry(String entryName) throws IOException { return new EntryImpl(entryName, getDocumentEntry(entryName, getFileSystem().getRoot())); } + @Override public boolean hasContentsEntry() throws IOException { return getFileSystem().getRoot().hasEntry(CONTENTS_ENTRY); } + @Override public EntryImpl getContentsEntry() throws IOException { return getEntry(CONTENTS_ENTRY); } @@ -230,30 +236,37 @@ public class CompoundOleUtil implements CompoundPackageFactory _docEntry = docEntry; } + @Override public ContentType getType() { return ContentType.UNKNOWN; } + @Override public String getName() { return _name; } + @Override public CompoundContentImpl getParent() { return CompoundContentImpl.this; } + @Override public OleBlobImpl getBlob() { return getParent().getBlob(); } + @Override public long length() { return _docEntry.getSize(); } + @Override public InputStream getStream() throws IOException { return new DocumentInputStream(_docEntry); } + @Override public void writeTo(OutputStream out) throws IOException { InputStream in = null; try { diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/CursorImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/CursorImpl.java index bc24e46..7b973a4 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/CursorImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/CursorImpl.java @@ -102,10 +102,12 @@ public abstract class CursorImpl implements Cursor return _rowState; } + @Override public IdImpl getId() { return _id; } + @Override public TableImpl getTable() { return _table; } @@ -118,18 +120,22 @@ public abstract class CursorImpl implements Cursor return getTable().getPageChannel(); } + @Override public ErrorHandler getErrorHandler() { return _rowState.getErrorHandler(); } + @Override public void setErrorHandler(ErrorHandler newErrorHandler) { _rowState.setErrorHandler(newErrorHandler); } + @Override public ColumnMatcher getColumnMatcher() { return _columnMatcher; } + @Override public void setColumnMatcher(ColumnMatcher columnMatcher) { if(columnMatcher == null) { columnMatcher = getDefaultColumnMatcher(); @@ -144,10 +150,12 @@ public abstract class CursorImpl implements Cursor return SimpleColumnMatcher.INSTANCE; } + @Override public SavepointImpl getSavepoint() { return new SavepointImpl(_id, _curPos, _prevPos); } + @Override public void restoreSavepoint(Savepoint savepoint) throws IOException { @@ -180,22 +188,27 @@ public abstract class CursorImpl implements Cursor return _lastPos; } + @Override public void reset() { beforeFirst(); } + @Override public void beforeFirst() { reset(MOVE_FORWARD); } + @Override public void afterLast() { reset(MOVE_REVERSE); } + @Override public boolean isBeforeFirst() throws IOException { return isAtBeginning(MOVE_FORWARD); } + @Override public boolean isAfterLast() throws IOException { return isAtBeginning(MOVE_REVERSE); } @@ -207,6 +220,7 @@ public abstract class CursorImpl implements Cursor return false; } + @Override public boolean isCurrentRowDeleted() throws IOException { // we need to ensure that the "deleted" flag has been read for this row @@ -224,10 +238,12 @@ public abstract class CursorImpl implements Cursor _rowState.reset(); } + @Override public Iterator<Row> iterator() { return new RowIterator(null, true, MOVE_FORWARD); } + @Override public IterableBuilder newIterable() { return new IterableBuilder(this); } @@ -260,34 +276,41 @@ public abstract class CursorImpl implements Cursor } } + @Override public void deleteCurrentRow() throws IOException { _table.deleteRow(_rowState, _curPos.getRowId()); } + @Override public Object[] updateCurrentRow(Object... row) throws IOException { return _table.updateRow(_rowState, _curPos.getRowId(), row); } + @Override public <M extends Map<String,Object>> M updateCurrentRowFromMap(M row) throws IOException { return _table.updateRowFromMap(_rowState, _curPos.getRowId(), row); } + @Override public Row getNextRow() throws IOException { return getNextRow(null); } + @Override public Row getNextRow(Collection<String> columnNames) throws IOException { return getAnotherRow(columnNames, MOVE_FORWARD); } + @Override public Row getPreviousRow() throws IOException { return getPreviousRow(null); } + @Override public Row getPreviousRow(Collection<String> columnNames) throws IOException { @@ -313,11 +336,13 @@ public abstract class CursorImpl implements Cursor return null; } + @Override public boolean moveToNextRow() throws IOException { return moveToAnotherRow(MOVE_FORWARD); } + @Override public boolean moveToPreviousRow() throws IOException { return moveToAnotherRow(MOVE_REVERSE); @@ -407,6 +432,7 @@ public abstract class CursorImpl implements Cursor return(!_curPos.equals(getDirHandler(moveForward).getEndPosition())); } + @Override public boolean findRow(RowId rowId) throws IOException { RowIdImpl rowIdImpl = (RowIdImpl)rowId; @@ -435,6 +461,7 @@ public abstract class CursorImpl implements Cursor } } + @Override public boolean findFirstRow(Column columnPattern, Object valuePattern) throws IOException { @@ -449,6 +476,7 @@ public abstract class CursorImpl implements Cursor prepareSearchInfo(columnPattern, valuePattern)); } + @Override public boolean findNextRow(Column columnPattern, Object valuePattern) throws IOException { @@ -489,12 +517,14 @@ public abstract class CursorImpl implements Cursor } } + @Override public boolean findFirstRow(Map<String,?> rowPattern) throws IOException { return findAnotherRow(rowPattern, true, MOVE_FORWARD, _columnMatcher, prepareSearchInfo(rowPattern)); } + @Override public boolean findNextRow(Map<String,?> rowPattern) throws IOException { @@ -528,6 +558,7 @@ public abstract class CursorImpl implements Cursor } } + @Override public boolean currentRowMatches(Column columnPattern, Object valuePattern) throws IOException { @@ -550,6 +581,7 @@ public abstract class CursorImpl implements Cursor getCurrentRowValue(columnPattern)); } + @Override public boolean currentRowMatches(Map<String,?> rowPattern) throws IOException { @@ -663,11 +695,13 @@ public abstract class CursorImpl implements Cursor return true; } + @Override public int moveNextRows(int numRows) throws IOException { return moveSomeRows(numRows, MOVE_FORWARD); } + @Override public int movePreviousRows(int numRows) throws IOException { return moveSomeRows(numRows, MOVE_REVERSE); @@ -688,17 +722,20 @@ public abstract class CursorImpl implements Cursor return numMovedRows; } + @Override public Row getCurrentRow() throws IOException { return getCurrentRow(null); } + @Override public Row getCurrentRow(Collection<String> columnNames) throws IOException { return _table.getRow(_rowState, _curPos.getRowId(), columnNames); } + @Override public Object getCurrentRowValue(Column column) throws IOException { @@ -711,6 +748,7 @@ public abstract class CursorImpl implements Cursor return _table.getRowValue(_rowState, _curPos.getRowId(), column); } + @Override public void setCurrentRowValue(Column column, Object value) throws IOException { @@ -802,6 +840,7 @@ public abstract class CursorImpl implements Cursor } } + @Override public boolean hasNext() { if(_hasNext == null) { try { @@ -814,6 +853,7 @@ public abstract class CursorImpl implements Cursor return _hasNext; } + @Override public Row next() { if(!hasNext()) { throw new NoSuchElementException(); @@ -827,6 +867,7 @@ public abstract class CursorImpl implements Cursor } } + @Override public void remove() { if(_validRow) { try { @@ -983,6 +1024,7 @@ public abstract class CursorImpl implements Cursor /** * Returns the unique RowId of the position of the cursor. */ + @Override public abstract RowIdImpl getRowId(); /** @@ -1010,10 +1052,12 @@ public abstract class CursorImpl implements Cursor _prevPos = prevPos; } + @Override public IdImpl getCursorId() { return _cursorId; } + @Override public PositionImpl getCurrentPosition() { return _curPos; } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/DBEvalContext.java b/src/main/java/com/healthmarketscience/jackcess/impl/DBEvalContext.java index 2fbec97..227cdd8 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/DBEvalContext.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/DBEvalContext.java @@ -57,10 +57,12 @@ public class DBEvalContext implements Expressionator.ParseContext, EvalConfig return _db; } + @Override public TemporalConfig getTemporalConfig() { return _temporal; } + @Override public void setTemporalConfig(TemporalConfig temporal) { if(_temporal != temporal) { _temporal = temporal; @@ -68,14 +70,17 @@ public class DBEvalContext implements Expressionator.ParseContext, EvalConfig } } + @Override public ZoneId getZoneId() { return _db.getZoneId(); } + @Override public NumericConfig getNumericConfig() { return _numeric; } + @Override public void setNumericConfig(NumericConfig numeric) { if(_numeric != numeric) { _numeric = numeric; @@ -83,22 +88,27 @@ public class DBEvalContext implements Expressionator.ParseContext, EvalConfig } } + @Override public FunctionLookup getFunctionLookup() { return _funcs; } + @Override public void setFunctionLookup(FunctionLookup lookup) { _funcs = lookup; } + @Override public Bindings getBindings() { return _bindings; } + @Override public void setBindings(Bindings bindings) { _bindings = bindings; } + @Override public DateTimeFormatter createDateFormatter(String formatStr) { if(_sdfs == null) { _sdfs = new SimpleCache<String,DateTimeFormatter>(MAX_CACHE_SIZE); @@ -111,6 +121,7 @@ public class DBEvalContext implements Expressionator.ParseContext, EvalConfig return sdf; } + @Override public DecimalFormat createDecimalFormat(String formatStr) { if(_dfs == null) { _dfs = new SimpleCache<String,DecimalFormat>(MAX_CACHE_SIZE); diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java index dcd4e18..1a34dbd 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/DatabaseImpl.java @@ -35,7 +35,6 @@ import java.text.SimpleDateFormat; import java.time.ZoneId; import java.util.ArrayList; import java.util.Arrays; -import java.util.Calendar; import java.util.Collection; import java.util.Collections; import java.util.Date; @@ -551,10 +550,12 @@ public class DatabaseImpl implements Database, ZoneContext readSystemCatalog(); } + @Override public File getFile() { return ((_file != null) ? _file.toFile() : null); } + @Override public Path getPath() { return _file; } @@ -611,27 +612,33 @@ public class DatabaseImpl implements Database, ZoneContext return _complexCols; } + @Override public ErrorHandler getErrorHandler() { return((_dbErrorHandler != null) ? _dbErrorHandler : ErrorHandler.DEFAULT); } + @Override public void setErrorHandler(ErrorHandler newErrorHandler) { _dbErrorHandler = newErrorHandler; } + @Override public LinkResolver getLinkResolver() { return((_linkResolver != null) ? _linkResolver : LinkResolver.DEFAULT); } + @Override public void setLinkResolver(LinkResolver newLinkResolver) { _linkResolver = newLinkResolver; } + @Override public Map<String,Database> getLinkedDatabases() { return ((_linkedDbs == null) ? Collections.<String,Database>emptyMap() : Collections.unmodifiableMap(_linkedDbs)); } + @Override public boolean isLinkedTable(Table table) throws IOException { if((table == null) || (this == table.getDatabase())) { @@ -674,6 +681,7 @@ public class DatabaseImpl implements Database, ZoneContext return _zoneId; } + @Override public void setZoneId(ZoneId newZoneId) { setZoneInfo(null, newZoneId); } @@ -706,11 +714,13 @@ public class DatabaseImpl implements Database, ZoneContext return _dtf; } + @Override public Charset getCharset() { return _charset; } + @Override public void setCharset(Charset newCharset) { if(newCharset == null) { newCharset = getDefaultCharset(getFormat()); @@ -718,10 +728,12 @@ public class DatabaseImpl implements Database, ZoneContext _charset = newCharset; } + @Override public Table.ColumnOrder getColumnOrder() { return _columnOrder; } + @Override public void setColumnOrder(Table.ColumnOrder newColumnOrder) { if(newColumnOrder == null) { newColumnOrder = getDefaultColumnOrder(); @@ -729,10 +741,12 @@ public class DatabaseImpl implements Database, ZoneContext _columnOrder = newColumnOrder; } + @Override public boolean isEnforceForeignKeys() { return _enforceForeignKeys; } + @Override public void setEnforceForeignKeys(Boolean newEnforceForeignKeys) { if(newEnforceForeignKeys == null) { newEnforceForeignKeys = getDefaultEnforceForeignKeys(); @@ -740,10 +754,12 @@ public class DatabaseImpl implements Database, ZoneContext _enforceForeignKeys = newEnforceForeignKeys; } + @Override public boolean isAllowAutoNumberInsert() { return _allowAutoNumInsert; } + @Override public void setAllowAutoNumberInsert(Boolean allowAutoNumInsert) { if(allowAutoNumInsert == null) { allowAutoNumInsert = getDefaultAllowAutoNumberInsert(); @@ -751,10 +767,12 @@ public class DatabaseImpl implements Database, ZoneContext _allowAutoNumInsert = allowAutoNumInsert; } + @Override public boolean isEvaluateExpressions() { return _evaluateExpressions; } + @Override public void setEvaluateExpressions(Boolean evaluateExpressions) { if(evaluateExpressions == null) { evaluateExpressions = getDefaultEvaluateExpressions(); @@ -762,10 +780,12 @@ public class DatabaseImpl implements Database, ZoneContext _evaluateExpressions = evaluateExpressions; } + @Override public ColumnValidatorFactory getColumnValidatorFactory() { return _validatorFactory; } + @Override public void setColumnValidatorFactory(ColumnValidatorFactory newFactory) { if(newFactory == null) { newFactory = SimpleColumnValidatorFactory.INSTANCE; @@ -780,6 +800,7 @@ public class DatabaseImpl implements Database, ZoneContext return _fkEnforcerSharedState; } + @Override public EvalConfig getEvalConfig() { return getEvalContext(); } @@ -817,6 +838,7 @@ public class DatabaseImpl implements Database, ZoneContext return _propsHandler; } + @Override public FileFormat getFileFormat() throws IOException { if(_fileFormat == null) { @@ -974,6 +996,7 @@ public class DatabaseImpl implements Database, ZoneContext } } + @Override public Set<String> getTableNames() throws IOException { if(_tableNames == null) { _tableNames = getTableNames(true, false, true); @@ -981,6 +1004,7 @@ public class DatabaseImpl implements Database, ZoneContext return _tableNames; } + @Override public Set<String> getSystemTableNames() throws IOException { return getTableNames(false, true, false); } @@ -995,6 +1019,7 @@ public class DatabaseImpl implements Database, ZoneContext return tableNames; } + @Override public Iterator<Table> iterator() { try { return new TableIterator(getTableNames()); @@ -1013,14 +1038,17 @@ public class DatabaseImpl implements Database, ZoneContext } } + @Override public TableIterableBuilder newIterable() { return new TableIterableBuilder(this); } + @Override public TableImpl getTable(String name) throws IOException { return getTable(name, false); } + @Override public TableMetaData getTableMetaData(String name) throws IOException { return getTableInfo(name, true); } @@ -1135,6 +1163,7 @@ public class DatabaseImpl implements Database, ZoneContext .toTable(this); } + @Override public void createLinkedTable(String name, String linkedDbName, String linkedTableName) throws IOException @@ -1181,6 +1210,7 @@ public class DatabaseImpl implements Database, ZoneContext addToAccessControlEntries(tdefPageNumber, _tableParentId, _newTableSIDs); } + @Override public List<Relationship> getRelationships(Table table1, Table table2) throws IOException { @@ -1208,6 +1238,7 @@ public class DatabaseImpl implements Database, ZoneContext return getRelationshipsImpl(table1, table2, true); } + @Override public List<Relationship> getRelationships(Table table) throws IOException { @@ -1219,12 +1250,14 @@ public class DatabaseImpl implements Database, ZoneContext return getRelationshipsImpl((TableImpl)table, null, true); } + @Override public List<Relationship> getRelationships() throws IOException { return getRelationshipsImpl(null, null, false); } + @Override public List<Relationship> getSystemRelationships() throws IOException { @@ -1367,6 +1400,7 @@ public class DatabaseImpl implements Database, ZoneContext return ((i == 0) ? origName : (origName + i)); } + @Override public List<Query> getQueries() throws IOException { // the queries table does not get loaded until first accessed @@ -1416,6 +1450,7 @@ public class DatabaseImpl implements Database, ZoneContext return queries; } + @Override public TableImpl getSystemTable(String tableName) throws IOException { return getTable(tableName, true); @@ -1431,6 +1466,7 @@ public class DatabaseImpl implements Database, ZoneContext return table; } + @Override public PropertyMap getDatabaseProperties() throws IOException { if(_dbPropMaps == null) { _dbPropMaps = getPropertiesForDbObject(OBJECT_NAME_DB_PROPS); @@ -1438,6 +1474,7 @@ public class DatabaseImpl implements Database, ZoneContext return _dbPropMaps.getDefault(); } + @Override public PropertyMap getSummaryProperties() throws IOException { if(_summaryPropMaps == null) { _summaryPropMaps = getPropertiesForDbObject(OBJECT_NAME_SUMMARY_PROPS); @@ -1445,6 +1482,7 @@ public class DatabaseImpl implements Database, ZoneContext return _summaryPropMaps.getDefault(); } + @Override public PropertyMap getUserDefinedProperties() throws IOException { if(_userDefPropMaps == null) { _userDefPropMaps = getPropertiesForDbObject(OBJECT_NAME_USERDEF_PROPS); @@ -1522,6 +1560,7 @@ public class DatabaseImpl implements Database, ZoneContext return getPropsHandler().read(propsBytes, objectId, rowId, owner); } + @Override public String getDatabasePassword() throws IOException { ByteBuffer buffer = takeSharedBuffer(); @@ -1788,6 +1827,7 @@ public class DatabaseImpl implements Database, ZoneContext return CursorImpl.createCursor(table); } + @Override public void flush() throws IOException { if(_linkedDbs != null) { for(Database linkedDb : _linkedDbs.values()) { @@ -1797,6 +1837,7 @@ public class DatabaseImpl implements Database, ZoneContext _pageChannel.flush(); } + @Override public void close() throws IOException { if(_linkedDbs != null) { for(Database linkedDb : _linkedDbs.values()) { @@ -2170,26 +2211,32 @@ public class DatabaseImpl implements Database, ZoneContext flags = newFlags; } + @Override public String getName() { return tableName; } + @Override public boolean isLinked() { return false; } + @Override public boolean isSystem() { return isSystemObject(flags); } + @Override public String getLinkedTableName() { return null; } + @Override public String getLinkedDbName() { return null; } + @Override public Table open(Database db) throws IOException { return ((DatabaseImpl)db).getTable(this, true); } @@ -2253,14 +2300,17 @@ public class DatabaseImpl implements Database, ZoneContext _tableNameIter = tableNames.iterator(); } + @Override public boolean hasNext() { return _tableNameIter.hasNext(); } + @Override public void remove() { throw new UnsupportedOperationException(); } + @Override public Table next() { if(!hasNext()) { throw new NoSuchElementException(); diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/DefaultCodecProvider.java b/src/main/java/com/healthmarketscience/jackcess/impl/DefaultCodecProvider.java index 811f5b4..11854e7 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/DefaultCodecProvider.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/DefaultCodecProvider.java @@ -48,6 +48,7 @@ public class DefaultCodecProvider implements CodecProvider * This implementation returns DUMMY_HANDLER for databases with no encoding * and UNSUPPORTED_HANDLER for databases with any encoding. */ + @Override public CodecHandler createHandler(PageChannel channel, Charset charset) throws IOException { @@ -80,14 +81,17 @@ public class DefaultCodecProvider implements CodecProvider */ public static class DummyHandler implements CodecHandler { + @Override public boolean canEncodePartialPage() { return true; } + @Override public boolean canDecodeInline() { return true; } + @Override public void decodePage(ByteBuffer inPage, ByteBuffer outPage, int pageNumber) throws IOException @@ -95,6 +99,7 @@ public class DefaultCodecProvider implements CodecProvider // does nothing } + @Override public ByteBuffer encodePage(ByteBuffer page, int pageNumber, int pageOffset) throws IOException @@ -111,14 +116,17 @@ public class DefaultCodecProvider implements CodecProvider */ public static class UnsupportedHandler implements CodecHandler { + @Override public boolean canEncodePartialPage() { return true; } + @Override public boolean canDecodeInline() { return true; } + @Override public void decodePage(ByteBuffer inPage, ByteBuffer outPage, int pageNumber) throws IOException @@ -126,6 +134,7 @@ public class DefaultCodecProvider implements CodecProvider throw new UnsupportedCodecException("Decoding not supported. Please choose a CodecProvider which supports reading the current database encoding."); } + @Override public ByteBuffer encodePage(ByteBuffer page, int pageNumber, int pageOffset) throws IOException diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/IndexCursorImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/IndexCursorImpl.java index 21024e2..6c58182 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/IndexCursorImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/IndexCursorImpl.java @@ -129,10 +129,12 @@ public class IndexCursorImpl extends CursorImpl implements IndexCursor return _indexEntryPattern; } + @Override public IndexImpl getIndex() { return _index; } + @Override public Row findRowByEntry(Object... entryValues) throws IOException { @@ -142,6 +144,7 @@ public class IndexCursorImpl extends CursorImpl implements IndexCursor return null; } + @Override public boolean findFirstRowByEntry(Object... entryValues) throws IOException { @@ -163,6 +166,7 @@ public class IndexCursorImpl extends CursorImpl implements IndexCursor } } + @Override public void findClosestRowByEntry(Object... entryValues) throws IOException { @@ -184,12 +188,14 @@ public class IndexCursorImpl extends CursorImpl implements IndexCursor } } + @Override public boolean currentRowMatchesEntry(Object... entryValues) throws IOException { return currentRowMatchesEntryImpl(toRowValues(entryValues), _columnMatcher); } + @Override public EntryIterableBuilder newEntryIterable(Object... entryValues) { return new EntryIterableBuilder(this, entryValues); } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/IndexData.java b/src/main/java/com/healthmarketscience/jackcess/impl/IndexData.java index f210a0a..ca91fef 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/IndexData.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/IndexData.java @@ -107,6 +107,7 @@ public class IndexData { public static final Comparator<byte[]> BYTE_CODE_COMPARATOR = new Comparator<byte[]>() { + @Override public int compare(byte[] left, byte[] right) { if(left == right) { return 0; @@ -1615,6 +1616,7 @@ public class IndexData { _flags = flags; } + @Override public ColumnImpl getColumn() { return _column; } @@ -1623,14 +1625,17 @@ public class IndexData { return _flags; } + @Override public boolean isAscending() { return((getFlags() & ASCENDING_COLUMN_FLAG) != 0); } + @Override public int getColumnIndex() { return getColumn().getColumnIndex(); } + @Override public String getName() { return getColumn().getName(); } @@ -2142,6 +2147,7 @@ public class IndexData { return(BYTE_CODE_COMPARATOR.compare(_entryBytes, o._entryBytes) == 0); } + @Override public int compareTo(Entry other) { if (this == other) { return 0; @@ -2611,6 +2617,7 @@ public class IndexData { return _entry.equals(entry); } + @Override public int compareTo(Position other) { if(this == other) { diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/IndexImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/IndexImpl.java index 5332432..60d80d5 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/IndexImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/IndexImpl.java @@ -112,6 +112,7 @@ public class IndexImpl implements Index, Comparable<IndexImpl> return _data; } + @Override public TableImpl getTable() { return getIndexData().getTable(); } @@ -140,6 +141,7 @@ public class IndexImpl implements Index, Comparable<IndexImpl> return getIndexData().getUniqueEntryCountOffset(); } + @Override public String getName() { return _name; } @@ -148,10 +150,12 @@ public class IndexImpl implements Index, Comparable<IndexImpl> _name = name; } + @Override public boolean isPrimaryKey() { return _indexType == PRIMARY_KEY_INDEX_TYPE; } + @Override public boolean isForeignKey() { return _indexType == FOREIGN_KEY_INDEX_TYPE; } @@ -160,6 +164,7 @@ public class IndexImpl implements Index, Comparable<IndexImpl> return _reference; } + @Override public IndexImpl getReferencedIndex() throws IOException { if(_reference == null) { @@ -204,26 +209,32 @@ public class IndexImpl implements Index, Comparable<IndexImpl> return refIndex; } + @Override public boolean shouldIgnoreNulls() { return getIndexData().shouldIgnoreNulls(); } + @Override public boolean isUnique() { return getIndexData().isUnique(); } + @Override public boolean isRequired() { return getIndexData().isRequired(); } + @Override public List<IndexData.ColumnDescriptor> getColumns() { return getIndexData().getColumns(); } + @Override public int getColumnCount() { return getIndexData().getColumnCount(); } + @Override public CursorBuilder newCursor() { return getTable().newCursor().setIndex(this); } @@ -367,6 +378,7 @@ public class IndexImpl implements Index, Comparable<IndexImpl> return sb.toString(); } + @Override public int compareTo(IndexImpl other) { if (_indexNumber > other.getIndexNumber()) { return 1; diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/InternalColumnValidator.java b/src/main/java/com/healthmarketscience/jackcess/impl/InternalColumnValidator.java index 3d4dab9..1755949 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/InternalColumnValidator.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/InternalColumnValidator.java @@ -53,6 +53,7 @@ abstract class InternalColumnValidator implements ColumnValidator intValidator._delegate = extValidator; } + @Override public final Object validate(Column col, Object val) throws IOException { val = _delegate.validate(col, val); return internalValidate(col, val); diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/OleUtil.java b/src/main/java/com/healthmarketscience/jackcess/impl/OleUtil.java index 466b6a4..0d61923 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/OleUtil.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/OleUtil.java @@ -471,10 +471,12 @@ public class OleUtil _bytes = bytes; } + @Override public void writeTo(OutputStream out) throws IOException { out.write(_bytes); } + @Override public Content getContent() throws IOException { if(_content == null) { _content = parseContent(this); @@ -482,16 +484,19 @@ public class OleUtil return _content; } + @Override public InputStream getBinaryStream() throws SQLException { return new ByteArrayInputStream(_bytes); } + @Override public InputStream getBinaryStream(long pos, long len) throws SQLException { return new ByteArrayInputStream(_bytes, fromJdbcOffset(pos), (int)len); } + @Override public long length() throws SQLException { return _bytes.length; } @@ -503,41 +508,50 @@ public class OleUtil return _bytes; } + @Override public byte[] getBytes(long pos, int len) throws SQLException { return ByteUtil.copyOf(_bytes, fromJdbcOffset(pos), len); } + @Override public long position(byte[] pattern, long start) throws SQLException { int pos = ByteUtil.findRange(PageChannel.wrap(_bytes), fromJdbcOffset(start), pattern); return((pos >= 0) ? toJdbcOffset(pos) : pos); } + @Override public long position(Blob pattern, long start) throws SQLException { return position(pattern.getBytes(1L, (int)pattern.length()), start); } + @Override public OutputStream setBinaryStream(long position) throws SQLException { throw new SQLFeatureNotSupportedException(); } + @Override public void truncate(long len) throws SQLException { throw new SQLFeatureNotSupportedException(); } + @Override public int setBytes(long pos, byte[] bytes) throws SQLException { throw new SQLFeatureNotSupportedException(); } + @Override public int setBytes(long pos, byte[] bytes, int offset, int lesn) throws SQLException { throw new SQLFeatureNotSupportedException(); } + @Override public void free() { close(); } + @Override public void close() { _bytes = null; ByteUtil.closeQuietly(_content); @@ -573,6 +587,7 @@ public class OleUtil _blob = blob; } + @Override public OleBlobImpl getBlob() { return _blob; } @@ -581,6 +596,7 @@ public class OleUtil return getBlob().getBytes(); } + @Override public void close() { // base does nothing } @@ -604,14 +620,17 @@ public class OleUtil _length = length; } + @Override public long length() { return _length; } + @Override public InputStream getStream() throws IOException { return new ByteArrayInputStream(getBytes(), _position, _length); } + @Override public void writeTo(OutputStream out) throws IOException { out.write(getBytes(), _position, _length); } @@ -644,14 +663,17 @@ public class OleUtil _typeName = typeName; } + @Override public String getPrettyName() { return _prettyName; } + @Override public String getClassName() { return _className; } + @Override public String getTypeName() { return _typeName; } @@ -685,22 +707,27 @@ public class OleUtil _filePath = filePath; } + @Override public ContentType getType() { return ContentType.LINK; } + @Override public String getFileName() { return _fileName; } + @Override public String getLinkPath() { return _linkPath; } + @Override public String getFilePath() { return _filePath; } + @Override public InputStream getLinkStream() throws IOException { return new FileInputStream(getLinkPath()); } @@ -735,18 +762,22 @@ public class OleUtil _localFilePath = localFilePath; } + @Override public ContentType getType() { return ContentType.SIMPLE_PACKAGE; } + @Override public String getFileName() { return _fileName; } + @Override public String getFilePath() { return _filePath; } + @Override public String getLocalFilePath() { return _localFilePath; } @@ -772,6 +803,7 @@ public class OleUtil super(blob, prettyName, className, typeName, position, length); } + @Override public ContentType getType() { return ContentType.OTHER; } @@ -789,6 +821,7 @@ public class OleUtil super(blob); } + @Override public ContentType getType() { return ContentType.UNKNOWN; } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/PageChannel.java b/src/main/java/com/healthmarketscience/jackcess/impl/PageChannel.java index 19d15fd..41c164c 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/PageChannel.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/PageChannel.java @@ -389,10 +389,12 @@ public class PageChannel implements Channel, Flushable { return ByteBuffer.allocate(size).order(order); } + @Override public void flush() throws IOException { _channel.force(true); } + @Override public void close() throws IOException { flush(); if(_closeChannel) { @@ -400,6 +402,7 @@ public class PageChannel implements Channel, Flushable { } } + @Override public boolean isOpen() { return _channel.isOpen(); } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/PropertyMapImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/PropertyMapImpl.java index dfcbb9d..a092e82 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/PropertyMapImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/PropertyMapImpl.java @@ -74,6 +74,7 @@ public class PropertyMapImpl implements PropertyMap _owner = owner; } + @Override public String getName() { return _mapName; } @@ -86,22 +87,27 @@ public class PropertyMapImpl implements PropertyMap return _owner; } + @Override public int getSize() { return _props.size(); } + @Override public boolean isEmpty() { return _props.isEmpty(); } + @Override public Property get(String name) { return _props.get(DatabaseImpl.toLookupName(name)); } + @Override public Object getValue(String name) { return getValue(name, null); } + @Override public Object getValue(String name, Object defaultValue) { Property prop = get(name); Object value = defaultValue; @@ -111,14 +117,17 @@ public class PropertyMapImpl implements PropertyMap return value; } + @Override public PropertyImpl put(String name, Object value) { return put(name, null, value, false); } + @Override public PropertyImpl put(String name, DataType type, Object value) { return put(name, type, value, false); } + @Override public void putAll(Iterable<? extends Property> props) { if(props == null) { return; @@ -136,6 +145,7 @@ public class PropertyMapImpl implements PropertyMap /** * Puts a property into this map with the given information. */ + @Override public PropertyImpl put(String name, DataType type, Object value, boolean isDdl) { PropertyImpl prop = (PropertyImpl)createProperty(name, type, value, isDdl); @@ -143,14 +153,17 @@ public class PropertyMapImpl implements PropertyMap return prop; } + @Override public PropertyImpl remove(String name) { return (PropertyImpl)_props.remove(DatabaseImpl.toLookupName(name)); } + @Override public Iterator<Property> iterator() { return _props.values().iterator(); } + @Override public void save() throws IOException { getOwner().save(); } @@ -243,22 +256,27 @@ public class PropertyMapImpl implements PropertyMap _value = value; } + @Override public String getName() { return _name; } + @Override public DataType getType() { return _type; } + @Override public Object getValue() { return _value; } + @Override public void setValue(Object newValue) { _value = newValue; } + @Override public boolean isDdl() { return _ddl; } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/PropertyMaps.java b/src/main/java/com/healthmarketscience/jackcess/impl/PropertyMaps.java index 61e1e07..e545574 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/PropertyMaps.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/PropertyMaps.java @@ -103,6 +103,7 @@ public class PropertyMaps implements Iterable<PropertyMapImpl> return map; } + @Override public Iterator<PropertyMapImpl> iterator() { return _maps.values().iterator(); } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/RelationshipImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/RelationshipImpl.java index 0cc2b90..a9342f8 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/RelationshipImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/RelationshipImpl.java @@ -83,22 +83,27 @@ public class RelationshipImpl implements Relationship _flags = flags; } + @Override public String getName() { return _name; } + @Override public Table getFromTable() { return _fromTable; } + @Override public List<Column> getFromColumns() { return _fromColumns; } + @Override public Table getToTable() { return _toTable; } + @Override public List<Column> getToColumns() { return _toColumns; } @@ -107,34 +112,42 @@ public class RelationshipImpl implements Relationship return _flags; } + @Override public boolean isOneToOne() { return hasFlag(ONE_TO_ONE_FLAG); } + @Override public boolean hasReferentialIntegrity() { return !hasFlag(NO_REFERENTIAL_INTEGRITY_FLAG); } + @Override public boolean cascadeUpdates() { return hasFlag(CASCADE_UPDATES_FLAG); } + @Override public boolean cascadeDeletes() { return hasFlag(CASCADE_DELETES_FLAG); } + @Override public boolean cascadeNullOnDelete() { return hasFlag(CASCADE_NULL_FLAG); } + @Override public boolean isLeftOuterJoin() { return hasFlag(LEFT_OUTER_JOIN_FLAG); } + @Override public boolean isRightOuterJoin() { return hasFlag(RIGHT_OUTER_JOIN_FLAG); } + @Override public JoinType getJoinType() { if(isLeftOuterJoin()) { return JoinType.LEFT_OUTER; diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/RowIdImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/RowIdImpl.java index 5ce8214..097823a 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/RowIdImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/RowIdImpl.java @@ -98,6 +98,7 @@ public class RowIdImpl implements RowId, Serializable return _type; } + @Override public int compareTo(RowId other) { return compareTo((RowIdImpl)other); } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/RowImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/RowImpl.java index 460d507..e89b070 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/RowImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/RowImpl.java @@ -55,59 +55,73 @@ public class RowImpl extends LinkedHashMap<String,Object> implements Row _id = (RowIdImpl)row.getId(); } + @Override public RowIdImpl getId() { return _id; } + @Override public String getString(String name) { return (String)get(name); } + @Override public Boolean getBoolean(String name) { return (Boolean)get(name); } + @Override public Byte getByte(String name) { return (Byte)get(name); } + @Override public Short getShort(String name) { return (Short)get(name); } + @Override public Integer getInt(String name) { return (Integer)get(name); } + @Override public BigDecimal getBigDecimal(String name) { return (BigDecimal)get(name); } + @Override public Float getFloat(String name) { return (Float)get(name); } + @Override public Double getDouble(String name) { return (Double)get(name); } + @Override @SuppressWarnings("deprecation") public Date getDate(String name) { return (Date)get(name); } + @Override public LocalDateTime getLocalDateTime(String name) { return (LocalDateTime)get(name); } + @Override public byte[] getBytes(String name) { return (byte[])get(name); } + @Override public ComplexValueForeignKey getForeignKey(String name) { return (ComplexValueForeignKey)get(name); } + @Override public OleBlob getBlob(String name) throws IOException { byte[] bytes = getBytes(name); return ((bytes != null) ? OleBlob.Builder.fromInternalData(bytes) : null); diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java index 9f6ae49..eafa376 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/TableImpl.java @@ -97,6 +97,7 @@ public class TableImpl implements Table, PropertyMaps.Owner the variable length offset table */ private static final Comparator<ColumnImpl> VAR_LEN_COLUMN_COMPARATOR = new Comparator<ColumnImpl>() { + @Override public int compare(ColumnImpl c1, ColumnImpl c2) { return ((c1.getVarLenTableIndex() < c2.getVarLenTableIndex()) ? -1 : ((c1.getVarLenTableIndex() > c2.getVarLenTableIndex()) ? 1 : @@ -107,6 +108,7 @@ public class TableImpl implements Table, PropertyMaps.Owner /** comparator which sorts columns based on their display index */ private static final Comparator<ColumnImpl> DISPLAY_ORDER_COMPARATOR = new Comparator<ColumnImpl>() { + @Override public int compare(ColumnImpl c1, ColumnImpl c2) { return ((c1.getDisplayIndex() < c2.getDisplayIndex()) ? -1 : ((c1.getDisplayIndex() > c2.getDisplayIndex()) ? 1 : @@ -320,14 +322,17 @@ public class TableImpl implements Table, PropertyMaps.Owner } } + @Override public String getName() { return _name; } + @Override public boolean isHidden() { return((_flags & DatabaseImpl.HIDDEN_OBJECT_FLAG) != 0); } + @Override public boolean isSystem() { return(_tableType != TYPE_USER); } @@ -339,10 +344,12 @@ public class TableImpl implements Table, PropertyMaps.Owner return _maxColumnCount; } + @Override public int getColumnCount() { return _columns.size(); } + @Override public DatabaseImpl getDatabase() { return _database; } @@ -361,11 +368,13 @@ public class TableImpl implements Table, PropertyMaps.Owner return getDatabase().getPageChannel(); } + @Override public ErrorHandler getErrorHandler() { return((_tableErrorHandler != null) ? _tableErrorHandler : getDatabase().getErrorHandler()); } + @Override public void setErrorHandler(ErrorHandler newErrorHandler) { _tableErrorHandler = newErrorHandler; } @@ -374,11 +383,13 @@ public class TableImpl implements Table, PropertyMaps.Owner return _tableDefPageNumber; } + @Override public boolean isAllowAutoNumberInsert() { return ((_allowAutoNumInsert != null) ? (boolean)_allowAutoNumInsert : getDatabase().isAllowAutoNumberInsert()); } + @Override public void setAllowAutoNumberInsert(Boolean allowAutoNumInsert) { _allowAutoNumInsert = allowAutoNumInsert; } @@ -432,10 +443,12 @@ public class TableImpl implements Table, PropertyMaps.Owner return _longValueBufferH; } + @Override public List<ColumnImpl> getColumns() { return Collections.unmodifiableList(_columns); } + @Override public ColumnImpl getColumn(String name) { for(ColumnImpl column : _columns) { if(column.getName().equalsIgnoreCase(name)) { @@ -455,6 +468,7 @@ public class TableImpl implements Table, PropertyMaps.Owner return false; } + @Override public PropertyMap getProperties() throws IOException { if(_props == null) { _props = getPropertyMaps().getDefault(); @@ -474,6 +488,7 @@ public class TableImpl implements Table, PropertyMaps.Owner return _propertyMaps; } + @Override public void propertiesUpdated() throws IOException { // propagate update to columns for(ColumnImpl col : _columns) { @@ -487,10 +502,12 @@ public class TableImpl implements Table, PropertyMaps.Owner _calcColEval.reSort(); } + @Override public List<IndexImpl> getIndexes() { return Collections.unmodifiableList(_indexes); } + @Override public IndexImpl getIndex(String name) { for(IndexImpl index : _indexes) { if(index.getName().equalsIgnoreCase(name)) { @@ -501,6 +518,7 @@ public class TableImpl implements Table, PropertyMaps.Owner "Index with name " + name + " does not exist on this table")); } + @Override public IndexImpl getPrimaryKeyIndex() { for(IndexImpl index : _indexes) { if(index.isPrimaryKey()) { @@ -511,6 +529,7 @@ public class TableImpl implements Table, PropertyMaps.Owner "No primary key index found")); } + @Override public IndexImpl getForeignKeyIndex(Table otherTable) { for(IndexImpl index : _indexes) { if(index.isForeignKey() && (index.getReference() != null) && @@ -592,6 +611,7 @@ public class TableImpl implements Table, PropertyMaps.Owner return _autoNumColumns; } + @Override public CursorImpl getDefaultCursor() { if(_defaultCursor == null) { _defaultCursor = CursorImpl.createCursor(this); @@ -599,14 +619,17 @@ public class TableImpl implements Table, PropertyMaps.Owner return _defaultCursor; } + @Override public CursorBuilder newCursor() { return new CursorBuilder(this); } + @Override public void reset() { getDefaultCursor().reset(); } + @Override public Row deleteRow(Row row) throws IOException { deleteRow(row.getId()); return row; @@ -690,6 +713,7 @@ public class TableImpl implements Table, PropertyMaps.Owner } } + @Override public Row getNextRow() throws IOException { return getDefaultCursor().getNextRow(); } @@ -1034,6 +1058,7 @@ public class TableImpl implements Table, PropertyMaps.Owner } } + @Override public Iterator<Row> iterator() { return getDefaultCursor().iterator(); } @@ -2081,6 +2106,7 @@ public class TableImpl implements Table, PropertyMaps.Owner return ByteUtil.getUnsignedVarInt(buffer, getFormat().SIZE_NAME_LENGTH); } + @Override public Object[] asRow(Map<String,?> rowMap) { return asRow(rowMap, null, false); } @@ -2096,6 +2122,7 @@ public class TableImpl implements Table, PropertyMaps.Owner return asRow(rowMap, null, true); } + @Override public Object[] asUpdateRow(Map<String,?> rowMap) { return asRow(rowMap, Column.KEEP_VALUE, false); } @@ -2137,10 +2164,12 @@ public class TableImpl implements Table, PropertyMaps.Owner return row; } + @Override public Object[] addRow(Object... row) throws IOException { return addRows(Collections.singletonList(row), false).get(0); } + @Override public <M extends Map<String,Object>> M addRowFromMap(M row) throws IOException { @@ -2152,12 +2181,14 @@ public class TableImpl implements Table, PropertyMaps.Owner return row; } + @Override public List<? extends Object[]> addRows(List<? extends Object[]> rows) throws IOException { return addRows(rows, true); } + @Override public <M extends Map<String,Object>> List<M> addRowsFromMaps(List<M> rows) throws IOException { @@ -2387,6 +2418,7 @@ public class TableImpl implements Table, PropertyMaps.Owner return false; } + @Override public Row updateRow(Row row) throws IOException { return updateRowFromMap( getDefaultCursor().getRowState(), (RowIdImpl)row.getId(), row); @@ -2998,6 +3030,7 @@ public class TableImpl implements Table, PropertyMaps.Owner } } + @Override public int getRowCount() { return _rowCount; } @@ -3360,6 +3393,7 @@ public class TableImpl implements Table, PropertyMaps.Owner _lastModCount = TableImpl.this._modCount; } + @Override public TableImpl getTable() { return TableImpl.this; } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/complex/AttachmentColumnInfoImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/complex/AttachmentColumnInfoImpl.java index 1789e92..3aff524 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/complex/AttachmentColumnInfoImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/complex/AttachmentColumnInfoImpl.java @@ -266,6 +266,7 @@ public class AttachmentColumnInfoImpl extends ComplexColumnInfoImpl<Attachment> _encodedData = encodedData; } + @Override public byte[] getFileData() throws IOException { if((_data == null) && (_encodedData != null)) { _data = decodeData(); @@ -273,11 +274,13 @@ public class AttachmentColumnInfoImpl extends ComplexColumnInfoImpl<Attachment> return _data; } + @Override public void setFileData(byte[] data) { _data = data; _encodedData = null; } + @Override public byte[] getEncodedFileData() throws IOException { if((_encodedData == null) && (_data != null)) { _encodedData = encodeData(); @@ -285,67 +288,83 @@ public class AttachmentColumnInfoImpl extends ComplexColumnInfoImpl<Attachment> return _encodedData; } + @Override public void setEncodedFileData(byte[] data) { _encodedData = data; _data = null; } + @Override public String getFileName() { return _name; } + @Override public void setFileName(String fileName) { _name = fileName; } + @Override public String getFileUrl() { return _url; } + @Override public void setFileUrl(String fileUrl) { _url = fileUrl; } + @Override public String getFileType() { return _type; } + @Override public void setFileType(String fileType) { _type = fileType; } + @Override public Date getFileTimeStamp() { return (Date)_timeStamp; } + @Override public void setFileTimeStamp(Date fileTimeStamp) { _timeStamp = fileTimeStamp; } + @Override public LocalDateTime getFileLocalTimeStamp() { return (LocalDateTime)_timeStamp; } + @Override public void setFileLocalTimeStamp(LocalDateTime fileTimeStamp) { _timeStamp = fileTimeStamp; } + @Override public Object getFileTimeStampObject() { return _timeStamp; } + @Override public Integer getFileFlags() { return _flags; } + @Override public void setFileFlags(Integer fileFlags) { _flags = fileFlags; } + @Override public void update() throws IOException { getComplexValueForeignKey().updateAttachment(this); } + @Override public void delete() throws IOException { getComplexValueForeignKey().deleteAttachment(this); } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/complex/ComplexColumnInfoImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/complex/ComplexColumnInfoImpl.java index 566af72..31c0e04 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/complex/ComplexColumnInfoImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/complex/ComplexColumnInfoImpl.java @@ -122,12 +122,14 @@ public abstract class ComplexColumnInfoImpl<V extends ComplexValue> return _typeCols; } + @Override public int countValues(int complexValueFk) throws IOException { return getRawValues(complexValueFk, Collections.singleton(_complexValFkCol.getName())) .size(); } + @Override public List<Row> getRawValues(int complexValueFk) throws IOException { @@ -148,6 +150,7 @@ public abstract class ComplexColumnInfoImpl<V extends ComplexValue> .setColumnNames(columnNames).iterator(); } + @Override public List<Row> getRawValues(int complexValueFk, Collection<String> columnNames) throws IOException @@ -166,6 +169,7 @@ public abstract class ComplexColumnInfoImpl<V extends ComplexValue> return values; } + @Override public List<V> getValues(ComplexValueForeignKey complexValueFk) throws IOException { @@ -189,6 +193,7 @@ public abstract class ComplexColumnInfoImpl<V extends ComplexValue> return values; } + @Override public ComplexValue.Id addRawValue(Map<String,?> rawValue) throws IOException { @@ -197,6 +202,7 @@ public abstract class ComplexColumnInfoImpl<V extends ComplexValue> return getValueId(row); } + @Override public ComplexValue.Id addValue(V value) throws IOException { Object[] row = asRow(newRowArray(), value); _flatTable.addRow(row); @@ -205,43 +211,51 @@ public abstract class ComplexColumnInfoImpl<V extends ComplexValue> return id; } + @Override public void addValues(Collection<? extends V> values) throws IOException { for(V value : values) { addValue(value); } } + @Override public ComplexValue.Id updateRawValue(Row rawValue) throws IOException { _flatTable.updateRow(rawValue); return getValueId(rawValue); } + @Override public ComplexValue.Id updateValue(V value) throws IOException { ComplexValue.Id id = value.getId(); updateRow(id, asRow(newRowArray(), value)); return id; } + @Override public void updateValues(Collection<? extends V> values) throws IOException { for(V value : values) { updateValue(value); } } + @Override public void deleteRawValue(Row rawValue) throws IOException { deleteRow(rawValue.getId()); } + @Override public void deleteValue(V value) throws IOException { deleteRow(value.getId().getRowId()); } + @Override public void deleteValues(Collection<? extends V> values) throws IOException { for(V value : values) { deleteValue(value); } } + @Override public void deleteAllValues(int complexValueFk) throws IOException { Iterator<Row> entryIter = getComplexValFkIter(complexValueFk, Collections.<String>emptySet()); @@ -255,6 +269,7 @@ public abstract class ComplexColumnInfoImpl<V extends ComplexValue> } } + @Override public void deleteAllValues(ComplexValueForeignKey complexValueFk) throws IOException { @@ -322,6 +337,7 @@ public abstract class ComplexColumnInfoImpl<V extends ComplexValue> } } + @Override public abstract ComplexDataType getType(); protected abstract V toValue( @@ -339,10 +355,12 @@ public abstract class ComplexColumnInfoImpl<V extends ComplexValue> _complexValueFk = complexValueFk; } + @Override public Id getId() { return _id; } + @Override public void setId(Id id) { if(_id == id) { // harmless, ignore @@ -354,10 +372,12 @@ public abstract class ComplexColumnInfoImpl<V extends ComplexValue> _id = id; } + @Override public ComplexValueForeignKey getComplexValueForeignKey() { return _complexValueFk; } + @Override public void setComplexValueForeignKey(ComplexValueForeignKey complexValueFk) { if(_complexValueFk == complexValueFk) { @@ -370,6 +390,7 @@ public abstract class ComplexColumnInfoImpl<V extends ComplexValue> _complexValueFk = complexValueFk; } + @Override public Column getColumn() { return _complexValueFk.getColumn(); } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/complex/MultiValueColumnInfoImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/complex/MultiValueColumnInfoImpl.java index 809cf88..65d77d8 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/complex/MultiValueColumnInfoImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/complex/MultiValueColumnInfoImpl.java @@ -96,18 +96,22 @@ public class MultiValueColumnInfoImpl extends ComplexColumnInfoImpl<SingleValue> _value = value; } + @Override public Object get() { return _value; } + @Override public void set(Object value) { _value = value; } + @Override public void update() throws IOException { getComplexValueForeignKey().updateMultiValue(this); } + @Override public void delete() throws IOException { getComplexValueForeignKey().deleteMultiValue(this); } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/complex/MultiValueColumnPropertyMap.java b/src/main/java/com/healthmarketscience/jackcess/impl/complex/MultiValueColumnPropertyMap.java index 7adc2e3..49aed52 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/complex/MultiValueColumnPropertyMap.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/complex/MultiValueColumnPropertyMap.java @@ -49,18 +49,22 @@ public class MultiValueColumnPropertyMap implements PropertyMap _complex = complex; } + @Override public String getName() { return _primary.getName(); } + @Override public int getSize() { return _primary.getSize() + _complex.getSize(); } + @Override public boolean isEmpty() { return _primary.isEmpty() && _complex.isEmpty(); } + @Override public Property get(String name) { Property prop = _primary.get(name); if(prop != null) { @@ -69,23 +73,28 @@ public class MultiValueColumnPropertyMap implements PropertyMap return _complex.get(name); } + @Override public Object getValue(String name) { return getValue(name, null); } + @Override public Object getValue(String name, Object defaultValue) { Property prop = get(name); return ((prop != null) ? prop.getValue() : defaultValue); } + @Override public Property put(String name, Object value) { return put(name, null, value, false); } + @Override public Property put(String name, DataType type, Object value) { return put(name, type, value, false); } + @Override public Property put(String name, DataType type, Object value, boolean isDdl) { // the only property which seems to go in the "primary" is the "multi // value" property @@ -95,6 +104,7 @@ public class MultiValueColumnPropertyMap implements PropertyMap return _complex.put(name, type, value, isDdl); } + @Override public void putAll(Iterable<? extends Property> props) { if(props == null) { return; @@ -109,6 +119,7 @@ public class MultiValueColumnPropertyMap implements PropertyMap } } + @Override public Property remove(String name) { if(isPrimaryKey(name)) { return _primary.remove(name); @@ -116,11 +127,13 @@ public class MultiValueColumnPropertyMap implements PropertyMap return _complex.remove(name); } + @Override public void save() throws IOException { _primary.save(); _complex.save(); } + @Override public Iterator<Property> iterator() { final List<Iterator<Property>> iters = new ArrayList<Iterator<Property>>(2); iters.add(_primary.iterator()); @@ -142,10 +155,12 @@ public class MultiValueColumnPropertyMap implements PropertyMap return null; } + @Override public boolean hasNext() { return (_next != null); } + @Override public Property next() { if(!hasNext()) { throw new NoSuchElementException(); @@ -155,6 +170,7 @@ public class MultiValueColumnPropertyMap implements PropertyMap return prop; } + @Override public void remove() { if(_cur != null) { _cur.remove(); diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/complex/UnsupportedColumnInfoImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/complex/UnsupportedColumnInfoImpl.java index a7a5dac..ce729a1 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/complex/UnsupportedColumnInfoImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/complex/UnsupportedColumnInfoImpl.java @@ -108,22 +108,27 @@ public class UnsupportedColumnInfoImpl _values = values; } + @Override public Map<String,Object> getValues() { return _values; } + @Override public Object get(String columnName) { return getValues().get(columnName); } + @Override public void set(String columnName, Object value) { getValues().put(columnName, value); } + @Override public void update() throws IOException { getComplexValueForeignKey().updateUnsupportedValue(this); } + @Override public void delete() throws IOException { getComplexValueForeignKey().deleteUnsupportedValue(this); } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/complex/VersionHistoryColumnInfoImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/complex/VersionHistoryColumnInfoImpl.java index 14667d0..944e2d3 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/complex/VersionHistoryColumnInfoImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/complex/VersionHistoryColumnInfoImpl.java @@ -170,22 +170,27 @@ public class VersionHistoryColumnInfoImpl extends ComplexColumnInfoImpl<Version> _modifiedDate = modifiedDate; } + @Override public String getValue() { return _value; } + @Override public Date getModifiedDate() { return (Date)_modifiedDate; } + @Override public LocalDateTime getModifiedLocalDate() { return (LocalDateTime)_modifiedDate; } + @Override public Object getModifiedDateObject() { return _modifiedDate; } + @Override public int compareTo(Version o) { Object d1 = getModifiedDateObject(); Object d2 = o.getModifiedDateObject(); @@ -218,11 +223,13 @@ public class VersionHistoryColumnInfoImpl extends ComplexColumnInfoImpl<Version> return c1.compareTo(c2); } + @Override public void update() throws IOException { throw new UnsupportedOperationException( "This column does not support value updates"); } + @Override public void delete() throws IOException { throw new UnsupportedOperationException( "This column does not support value deletes"); diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/BaseDelayedValue.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/BaseDelayedValue.java index 1e99e64..8c2b9de 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/BaseDelayedValue.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/BaseDelayedValue.java @@ -40,42 +40,52 @@ public abstract class BaseDelayedValue implements Value return _val; } + @Override public boolean isNull() { return(getType() == Type.NULL); } + @Override public Value.Type getType() { return getDelegate().getType(); } + @Override public Object get() { return getDelegate().get(); } + @Override public boolean getAsBoolean(LocaleContext ctx) { return getDelegate().getAsBoolean(ctx); } + @Override public String getAsString(LocaleContext ctx) { return getDelegate().getAsString(ctx); } + @Override public LocalDateTime getAsLocalDateTime(LocaleContext ctx) { return getDelegate().getAsLocalDateTime(ctx); } + @Override public Value getAsDateTimeValue(LocaleContext ctx) { return getDelegate().getAsDateTimeValue(ctx); } + @Override public Integer getAsLongInt(LocaleContext ctx) { return getDelegate().getAsLongInt(ctx); } + @Override public Double getAsDouble(LocaleContext ctx) { return getDelegate().getAsDouble(ctx); } + @Override public BigDecimal getAsBigDecimal(LocaleContext ctx) { return getDelegate().getAsBigDecimal(ctx); } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/BaseValue.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/BaseValue.java index 35e6ccf..e2a7453 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/BaseValue.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/BaseValue.java @@ -29,34 +29,42 @@ import com.healthmarketscience.jackcess.expr.Value; */ public abstract class BaseValue implements Value { + @Override public boolean isNull() { return(getType() == Type.NULL); } + @Override public boolean getAsBoolean(LocaleContext ctx) { throw invalidConversion(Type.LONG); } + @Override public String getAsString(LocaleContext ctx) { throw invalidConversion(Type.STRING); } + @Override public LocalDateTime getAsLocalDateTime(LocaleContext ctx) { return (LocalDateTime)getAsDateTimeValue(ctx).get(); } + @Override public Value getAsDateTimeValue(LocaleContext ctx) { throw invalidConversion(Type.DATE_TIME); } + @Override public Integer getAsLongInt(LocaleContext ctx) { throw invalidConversion(Type.LONG); } + @Override public Double getAsDouble(LocaleContext ctx) { throw invalidConversion(Type.DOUBLE); } + @Override public BigDecimal getAsBigDecimal(LocaleContext ctx) { throw invalidConversion(Type.BIG_DEC); } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/BigDecimalValue.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/BigDecimalValue.java index 0e78f90..56bc911 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/BigDecimalValue.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/BigDecimalValue.java @@ -33,10 +33,12 @@ public class BigDecimalValue extends BaseNumericValue _val = val; } + @Override public Type getType() { return Type.BIG_DEC; } + @Override public Object get() { return _val; } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/DateTimeValue.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/DateTimeValue.java index f9d1e7b..9b58941 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/DateTimeValue.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/DateTimeValue.java @@ -40,10 +40,12 @@ public class DateTimeValue extends BaseValue _val = val; } + @Override public Type getType() { return _type; } + @Override public Object get() { return _val; } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctions.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctions.java index 763d1d5..5a871e4 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctions.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctions.java @@ -53,6 +53,7 @@ public class DefaultFunctions } public static final FunctionLookup LOOKUP = new FunctionLookup() { + @Override public Function getFunction(String name) { return FUNCS.get(DatabaseImpl.toLookupName(name)); } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/DoubleValue.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/DoubleValue.java index d37c90b..e00e24a 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/DoubleValue.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/DoubleValue.java @@ -33,10 +33,12 @@ public class DoubleValue extends BaseNumericValue _val = val; } + @Override public Type getType() { return Type.DOUBLE; } + @Override public Object get() { return _val; } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/Expressionator.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/Expressionator.java index 92da3f6..d9cf5b9 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/Expressionator.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/Expressionator.java @@ -1685,22 +1685,27 @@ public class Expressionator return areConstant(_left, _right); } + @Override public OpType getOp() { return _op; } + @Override public Expr getLeft() { return _left; } + @Override public void setLeft(Expr left) { _left = left; } + @Override public Expr getRight() { return _right; } + @Override public void setRight(Expr right) { _right = right; } @@ -1748,14 +1753,17 @@ public class Expressionator return _expr.isConstant(); } + @Override public OpType getOp() { return _op; } + @Override public Expr getRight() { return _expr; } + @Override public void setRight(Expr right) { _expr = right; } @@ -1854,14 +1862,17 @@ public class Expressionator return _expr.isConstant(); } + @Override public OpType getOp() { return _op; } + @Override public Expr getLeft() { return _expr; } + @Override public void setLeft(Expr left) { _expr = left; } @@ -1986,10 +1997,12 @@ public class Expressionator return _expr.isConstant() && areConstant(_startRangeExpr, _endRangeExpr); } + @Override public Expr getRight() { return _endRangeExpr; } + @Override public void setRight(Expr right) { _endRangeExpr = right; } @@ -2032,22 +2045,27 @@ public class Expressionator _expr = expr; } + @Override public String toDebugString(LocaleContext ctx) { return _expr.toDebugString(ctx); } + @Override public String toRawString() { return _rawExprStr; } + @Override public String toCleanString(LocaleContext ctx) { return _expr.toCleanString(ctx); } + @Override public boolean isConstant() { return _expr.isConstant(); } + @Override public void collectIdentifiers(Collection<Identifier> identifiers) { _expr.collectIdentifiers(identifiers); } @@ -2112,6 +2130,7 @@ public class Expressionator _resultType = resultType; } + @Override public Object eval(EvalContext ctx) { return evalValue(_resultType, ctx); } @@ -2127,6 +2146,7 @@ public class Expressionator super(rawExprStr, expr); } + @Override public Object eval(EvalContext ctx) { return evalCondition(ctx); } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/FunctionSupport.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/FunctionSupport.java index aa978e2..b9cbb1a 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/FunctionSupport.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/FunctionSupport.java @@ -47,10 +47,12 @@ public class FunctionSupport _maxParams = maxParams; } + @Override public String getName() { return _name; } + @Override public boolean isPure() { // most functions are probably pure, so make this the default return true; @@ -94,6 +96,7 @@ public class FunctionSupport return false; } + @Override public final Value eval(EvalContext ctx, Value... params) { try { validateNumParams(params); @@ -112,6 +115,7 @@ public class FunctionSupport super(name, 1, 1); } + @Override public final Value eval(EvalContext ctx, Value... params) { try { validateNumParams(params); @@ -130,6 +134,7 @@ public class FunctionSupport super(name, 1, 1); } + @Override public final Value eval(EvalContext ctx, Value... params) { try { validateNumParams(params); @@ -152,6 +157,7 @@ public class FunctionSupport super(name, 2, 2); } + @Override public final Value eval(EvalContext ctx, Value... params) { try { validateNumParams(params); @@ -170,6 +176,7 @@ public class FunctionSupport super(name, 3, 3); } + @Override public final Value eval(EvalContext ctx, Value... params) { try { validateNumParams(params); @@ -193,6 +200,7 @@ public class FunctionSupport super(name, minParams, maxParams); } + @Override public final Value eval(EvalContext ctx, Value... params) { try { validateNumParams(params); @@ -215,14 +223,17 @@ public class FunctionSupport _name = _delegate.getName() + NON_VAR_SUFFIX; } + @Override public String getName() { return _name; } + @Override public boolean isPure() { return _delegate.isPure(); } + @Override public Value eval(EvalContext ctx, Value... params) { Value result = _delegate.eval(ctx, params); if(result.isNull()) { diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/LongValue.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/LongValue.java index 30025ad..27aa715 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/LongValue.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/LongValue.java @@ -33,10 +33,12 @@ public class LongValue extends BaseNumericValue _val = val; } + @Override public Type getType() { return Type.LONG; } + @Override public Object get() { return _val; } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/StringValue.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/StringValue.java index ca74f35..ff799be 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/StringValue.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/StringValue.java @@ -40,10 +40,12 @@ public class StringValue extends BaseValue _val = val; } + @Override public Type getType() { return Type.STRING; } + @Override public Object get() { return _val; } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/ValueSupport.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/ValueSupport.java index 805cc32..e7be9bc 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/ValueSupport.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/ValueSupport.java @@ -39,9 +39,11 @@ public class ValueSupport @Override public boolean isNull() { return true; } + @Override public Type getType() { return Type.NULL; } + @Override public Object get() { return null; } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/query/AppendQueryImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/query/AppendQueryImpl.java index 140fde3..3567c57 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/query/AppendQueryImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/query/AppendQueryImpl.java @@ -36,10 +36,12 @@ public class AppendQueryImpl extends BaseSelectQueryImpl implements AppendQuery super(name, rows, objectId, objectFlag, Type.APPEND); } + @Override public String getTargetTable() { return getTypeRow().name1; } + @Override public List<String> getTargetColumns() { return new RowFormatter(getTargetRows()) { @Override protected void format(StringBuilder builder, Row row) { @@ -48,14 +50,17 @@ public class AppendQueryImpl extends BaseSelectQueryImpl implements AppendQuery }.format(); } + @Override public String getRemoteDbPath() { return getTypeRow().name2; } + @Override public String getRemoteDbType() { return getTypeRow().expression; } + @Override public List<String> getValues() { return new RowFormatter(getValueRows()) { @Override protected void format(StringBuilder builder, Row row) { diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/query/BaseSelectQueryImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/query/BaseSelectQueryImpl.java index c213dd0..691ca9a 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/query/BaseSelectQueryImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/query/BaseSelectQueryImpl.java @@ -77,6 +77,7 @@ public abstract class BaseSelectQueryImpl extends QueryImpl } } + @Override public String getSelectType() { if(hasFlag(DISTINCT_SELECT_TYPE)) { @@ -99,6 +100,7 @@ public abstract class BaseSelectQueryImpl extends QueryImpl return DEFAULT_TYPE; } + @Override public List<String> getSelectColumns() { List<String> result = (new RowFormatter(getColumnRows()) { @@ -143,6 +145,7 @@ public abstract class BaseSelectQueryImpl extends QueryImpl return super.getWhereExpression(); } + @Override public List<String> getGroupings() { return (new RowFormatter(getGroupByRows()) { @@ -152,6 +155,7 @@ public abstract class BaseSelectQueryImpl extends QueryImpl }).format(); } + @Override public String getHavingExpression() { return getHavingRow().expression; diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/query/CrossTabQueryImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/query/CrossTabQueryImpl.java index 930f785..240e085 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/query/CrossTabQueryImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/query/CrossTabQueryImpl.java @@ -59,6 +59,7 @@ public class CrossTabQueryImpl extends BaseSelectQueryImpl CROSSTAB_PIVOT_FLAG)); } + @Override public String getTransformExpression() { Row row = getTransformRow(); if(row.expression == null) { @@ -69,6 +70,7 @@ public class CrossTabQueryImpl extends BaseSelectQueryImpl return toAlias(builder, row.name1).toString(); } + @Override public String getPivotExpression() { return getPivotRow().expression; } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/query/DataDefinitionQueryImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/query/DataDefinitionQueryImpl.java index 5d1024f..5496e29 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/query/DataDefinitionQueryImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/query/DataDefinitionQueryImpl.java @@ -34,6 +34,7 @@ public class DataDefinitionQueryImpl extends QueryImpl super(name, rows, objectId, objectFlag, Type.DATA_DEFINITION); } + @Override public String getDDLString() { return getTypeRow().expression; } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/query/MakeTableQueryImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/query/MakeTableQueryImpl.java index 7a153a5..27880cf 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/query/MakeTableQueryImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/query/MakeTableQueryImpl.java @@ -35,14 +35,17 @@ public class MakeTableQueryImpl extends BaseSelectQueryImpl super(name, rows, objectId, objectFlag, Type.MAKE_TABLE); } + @Override public String getTargetTable() { return getTypeRow().name1; } + @Override public String getRemoteDbPath() { return getTypeRow().name2; } + @Override public String getRemoteDbType() { return getTypeRow().expression; } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/query/PassthroughQueryImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/query/PassthroughQueryImpl.java index cfbcdc5..56b672b 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/query/PassthroughQueryImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/query/PassthroughQueryImpl.java @@ -34,10 +34,12 @@ public class PassthroughQueryImpl extends QueryImpl implements PassthroughQuery super(name, rows, objectId, objectFlag, Type.PASSTHROUGH); } + @Override public String getConnectionString() { return getTypeRow().name1; } + @Override public String getPassthroughString() { return getTypeRow().expression; } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/query/QueryImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/query/QueryImpl.java index 389ca90..2bbc279 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/query/QueryImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/query/QueryImpl.java @@ -73,6 +73,7 @@ public abstract class QueryImpl implements Query /** * Returns the name of the query. */ + @Override public String getName() { return _name; } @@ -80,10 +81,12 @@ public abstract class QueryImpl implements Query /** * Returns the type of the query. */ + @Override public Type getType() { return _type; } + @Override public boolean isHidden() { return((_objectFlag & DatabaseImpl.HIDDEN_OBJECT_FLAG) != 0); } @@ -91,10 +94,12 @@ public abstract class QueryImpl implements Query /** * Returns the unique object id of the query. */ + @Override public int getObjectId() { return _objectId; } + @Override public int getObjectFlag() { return _objectFlag; } @@ -170,6 +175,7 @@ public abstract class QueryImpl implements Query } } + @Override public List<String> getParameters() { return (new RowFormatter(getParameterRows()) { @@ -299,6 +305,7 @@ public abstract class QueryImpl implements Query }).format(); } + @Override public String getOwnerAccessType() { return(hasFlag(OWNER_ACCESS_SELECT_TYPE) ? "WITH OWNERACCESS OPTION" : DEFAULT_TYPE); @@ -316,6 +323,7 @@ public abstract class QueryImpl implements Query /** * Returns the actual SQL string which this query data represents. */ + @Override public String toSQLString() { StringBuilder builder = new StringBuilder(); diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/query/UnionQueryImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/query/UnionQueryImpl.java index f74aefd..c9b198b 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/query/UnionQueryImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/query/UnionQueryImpl.java @@ -35,14 +35,17 @@ public class UnionQueryImpl extends QueryImpl implements UnionQuery super(name, rows, objectId, objectFlag, Type.UNION); } + @Override public String getUnionType() { return(hasFlag(UNION_FLAG) ? DEFAULT_TYPE : "ALL"); } + @Override public String getUnionString1() { return getUnionString(UNION_PART1); } + @Override public String getUnionString2() { return getUnionString(UNION_PART2); } diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/query/UpdateQueryImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/query/UpdateQueryImpl.java index 9cf722a..afea512 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/query/UpdateQueryImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/query/UpdateQueryImpl.java @@ -36,21 +36,25 @@ public class UpdateQueryImpl extends QueryImpl implements UpdateQuery super(name, rows, objectId, objectFlag, Type.UPDATE); } + @Override public List<String> getTargetTables() { return super.getFromTables(); } + @Override public String getRemoteDbPath() { return super.getFromRemoteDbPath(); } + @Override public String getRemoteDbType() { return super.getFromRemoteDbType(); } + @Override public List<String> getNewValues() { return (new RowFormatter(getColumnRows()) { diff --git a/src/main/java/com/healthmarketscience/jackcess/util/CaseInsensitiveColumnMatcher.java b/src/main/java/com/healthmarketscience/jackcess/util/CaseInsensitiveColumnMatcher.java index e44002e..f527bb2 100644 --- a/src/main/java/com/healthmarketscience/jackcess/util/CaseInsensitiveColumnMatcher.java +++ b/src/main/java/com/healthmarketscience/jackcess/util/CaseInsensitiveColumnMatcher.java @@ -41,6 +41,7 @@ public class CaseInsensitiveColumnMatcher implements ColumnMatcher { public CaseInsensitiveColumnMatcher() { } + @Override public boolean matches(Table table, String columnName, Object value1, Object value2) { diff --git a/src/main/java/com/healthmarketscience/jackcess/util/CustomLinkResolver.java b/src/main/java/com/healthmarketscience/jackcess/util/CustomLinkResolver.java index 1dc0b80..e36c569 100644 --- a/src/main/java/com/healthmarketscience/jackcess/util/CustomLinkResolver.java +++ b/src/main/java/com/healthmarketscience/jackcess/util/CustomLinkResolver.java @@ -133,6 +133,7 @@ public abstract class CustomLinkResolver implements LinkResolver * @see #createTempDb * @see LinkResolver#DEFAULT */ + @Override public Database resolveLinkedDatabase(Database linkerDb, String linkeeFileName) throws IOException { diff --git a/src/main/java/com/healthmarketscience/jackcess/util/EntryIterableBuilder.java b/src/main/java/com/healthmarketscience/jackcess/util/EntryIterableBuilder.java index 9a112d8..220d525 100644 --- a/src/main/java/com/healthmarketscience/jackcess/util/EntryIterableBuilder.java +++ b/src/main/java/com/healthmarketscience/jackcess/util/EntryIterableBuilder.java @@ -106,6 +106,7 @@ public class EntryIterableBuilder implements Iterable<Row> return this; } + @Override public Iterator<Row> iterator() { return ((IndexCursorImpl)_cursor).entryIterator(this); } diff --git a/src/main/java/com/healthmarketscience/jackcess/util/ErrorHandler.java b/src/main/java/com/healthmarketscience/jackcess/util/ErrorHandler.java index f47ea54..fe9197b 100644 --- a/src/main/java/com/healthmarketscience/jackcess/util/ErrorHandler.java +++ b/src/main/java/com/healthmarketscience/jackcess/util/ErrorHandler.java @@ -38,6 +38,7 @@ public interface ErrorHandler * @usage _general_field_ */ public static final ErrorHandler DEFAULT = new ErrorHandler() { + @Override public Object handleRowError(Column column, byte[] columnData, Location location, Exception error) throws IOException @@ -84,6 +85,7 @@ public interface ErrorHandler /** * Contains details about the errored row, useful for debugging. */ + @Override public String toString(); } } diff --git a/src/main/java/com/healthmarketscience/jackcess/util/IterableBuilder.java b/src/main/java/com/healthmarketscience/jackcess/util/IterableBuilder.java index edb635d..3865152 100644 --- a/src/main/java/com/healthmarketscience/jackcess/util/IterableBuilder.java +++ b/src/main/java/com/healthmarketscience/jackcess/util/IterableBuilder.java @@ -178,6 +178,7 @@ public class IterableBuilder implements Iterable<Row> return this; } + @Override public Iterator<Row> iterator() { return ((CursorImpl)_cursor).iterator(this); } diff --git a/src/main/java/com/healthmarketscience/jackcess/util/LinkResolver.java b/src/main/java/com/healthmarketscience/jackcess/util/LinkResolver.java index 5310449..c1beee3 100644 --- a/src/main/java/com/healthmarketscience/jackcess/util/LinkResolver.java +++ b/src/main/java/com/healthmarketscience/jackcess/util/LinkResolver.java @@ -36,6 +36,7 @@ public interface LinkResolver * @usage _general_field_ */ public static final LinkResolver DEFAULT = new LinkResolver() { + @Override public Database resolveLinkedDatabase(Database linkerDb, String linkeeFileName) throws IOException diff --git a/src/main/java/com/healthmarketscience/jackcess/util/ReplacementErrorHandler.java b/src/main/java/com/healthmarketscience/jackcess/util/ReplacementErrorHandler.java index d7e2e2b..3298fd3 100644 --- a/src/main/java/com/healthmarketscience/jackcess/util/ReplacementErrorHandler.java +++ b/src/main/java/com/healthmarketscience/jackcess/util/ReplacementErrorHandler.java @@ -47,6 +47,7 @@ public class ReplacementErrorHandler implements ErrorHandler _replacement = replacement; } + @Override public Object handleRowError(Column column, byte[] columnData, Location location, Exception error) throws IOException diff --git a/src/main/java/com/healthmarketscience/jackcess/util/RowFilter.java b/src/main/java/com/healthmarketscience/jackcess/util/RowFilter.java index 607bf9a..a579176 100644 --- a/src/main/java/com/healthmarketscience/jackcess/util/RowFilter.java +++ b/src/main/java/com/healthmarketscience/jackcess/util/RowFilter.java @@ -163,12 +163,14 @@ public abstract class RowFilter * iterable, returning only rows for which the {@link RowFilter#matches} * method returns {@code true} */ + @Override public Iterator<Row> iterator() { return new Iterator<Row>() { private final Iterator<? extends Row> _iter = _iterable.iterator(); private Row _next; + @Override public boolean hasNext() { while(_iter.hasNext()) { _next = _iter.next(); @@ -180,6 +182,7 @@ public abstract class RowFilter return false; } + @Override public Row next() { if(_next == null) { throw new NoSuchElementException(); @@ -187,6 +190,7 @@ public abstract class RowFilter return _next; } + @Override public void remove() { throw new UnsupportedOperationException(); } diff --git a/src/main/java/com/healthmarketscience/jackcess/util/SimpleColumnMatcher.java b/src/main/java/com/healthmarketscience/jackcess/util/SimpleColumnMatcher.java index b814e93..6661948 100644 --- a/src/main/java/com/healthmarketscience/jackcess/util/SimpleColumnMatcher.java +++ b/src/main/java/com/healthmarketscience/jackcess/util/SimpleColumnMatcher.java @@ -41,6 +41,7 @@ public class SimpleColumnMatcher implements ColumnMatcher { public SimpleColumnMatcher() { } + @Override public boolean matches(Table table, String columnName, Object value1, Object value2) { diff --git a/src/main/java/com/healthmarketscience/jackcess/util/SimpleColumnValidator.java b/src/main/java/com/healthmarketscience/jackcess/util/SimpleColumnValidator.java index 3c77cda..62fe900 100644 --- a/src/main/java/com/healthmarketscience/jackcess/util/SimpleColumnValidator.java +++ b/src/main/java/com/healthmarketscience/jackcess/util/SimpleColumnValidator.java @@ -31,6 +31,7 @@ public class SimpleColumnValidator implements ColumnValidator { public static final SimpleColumnValidator INSTANCE = new SimpleColumnValidator(); + @Override public Object validate(Column col, Object val) throws IOException { return val; } diff --git a/src/main/java/com/healthmarketscience/jackcess/util/SimpleColumnValidatorFactory.java b/src/main/java/com/healthmarketscience/jackcess/util/SimpleColumnValidatorFactory.java index f36556b..0c9e6b6 100644 --- a/src/main/java/com/healthmarketscience/jackcess/util/SimpleColumnValidatorFactory.java +++ b/src/main/java/com/healthmarketscience/jackcess/util/SimpleColumnValidatorFactory.java @@ -30,6 +30,7 @@ public class SimpleColumnValidatorFactory implements ColumnValidatorFactory public static final SimpleColumnValidatorFactory INSTANCE = new SimpleColumnValidatorFactory(); + @Override public ColumnValidator createValidator(Column col) { return SimpleColumnValidator.INSTANCE; } diff --git a/src/main/java/com/healthmarketscience/jackcess/util/SimpleExportFilter.java b/src/main/java/com/healthmarketscience/jackcess/util/SimpleExportFilter.java index f86a236..15a55b7 100644 --- a/src/main/java/com/healthmarketscience/jackcess/util/SimpleExportFilter.java +++ b/src/main/java/com/healthmarketscience/jackcess/util/SimpleExportFilter.java @@ -34,10 +34,12 @@ public class SimpleExportFilter implements ExportFilter { public SimpleExportFilter() { } + @Override public List<Column> filterColumns(List<Column> columns) throws IOException { return columns; } + @Override public Object[] filterRow(Object[] row) throws IOException { return row; } diff --git a/src/main/java/com/healthmarketscience/jackcess/util/SimpleImportFilter.java b/src/main/java/com/healthmarketscience/jackcess/util/SimpleImportFilter.java index f8fbab1..2d6b726 100644 --- a/src/main/java/com/healthmarketscience/jackcess/util/SimpleImportFilter.java +++ b/src/main/java/com/healthmarketscience/jackcess/util/SimpleImportFilter.java @@ -36,6 +36,7 @@ public class SimpleImportFilter implements ImportFilter { public SimpleImportFilter() { } + @Override public List<ColumnBuilder> filterColumns(List<ColumnBuilder> destColumns, ResultSetMetaData srcColumns) throws SQLException, IOException @@ -43,6 +44,7 @@ public class SimpleImportFilter implements ImportFilter { return destColumns; } + @Override public Object[] filterRow(Object[] row) throws SQLException, IOException { diff --git a/src/main/java/com/healthmarketscience/jackcess/util/TableIterableBuilder.java b/src/main/java/com/healthmarketscience/jackcess/util/TableIterableBuilder.java index 168d758..da6d1b5 100644 --- a/src/main/java/com/healthmarketscience/jackcess/util/TableIterableBuilder.java +++ b/src/main/java/com/healthmarketscience/jackcess/util/TableIterableBuilder.java @@ -87,6 +87,7 @@ public class TableIterableBuilder implements Iterable<Table> return setIncludeLinkedTables(false); } + @Override public Iterator<Table> iterator() { return ((DatabaseImpl)_db).iterator(this); } |