提交 d64f8cd9 authored 作者: Noel Grandin's avatar Noel Grandin

improve javadoc

上级 eeb63bf7
...@@ -6879,10 +6879,10 @@ public class Parser { ...@@ -6879,10 +6879,10 @@ public class Parser {
} }
/** /**
* @param s * Is this a simple identifier (in the JDBC specification sense).
* identifier to check *
* @param functionsAsKeywords * @param s identifier to check
* treat system functions as keywords * @param functionsAsKeywords treat system functions as keywords
* @return is specified identifier may be used without quotes * @return is specified identifier may be used without quotes
* @throws NullPointerException if s is {@code null} * @throws NullPointerException if s is {@code null}
*/ */
......
...@@ -442,7 +442,7 @@ public abstract class Prepared { ...@@ -442,7 +442,7 @@ public abstract class Prepared {
} }
/** /**
* Get the temporary views created for CTE's. * @return the temporary views created for CTE's.
*/ */
public List<TableView> getCteCleanups() { public List<TableView> getCteCleanups() {
return cteCleanups; return cteCleanups;
......
...@@ -198,7 +198,7 @@ public class MergeUsing extends Prepared { ...@@ -198,7 +198,7 @@ public class MergeUsing extends Prepared {
/** /**
* Merge the given row. * Merge the given row.
* *
* @param row the row * @param sourceRow the row
*/ */
protected void merge(Row sourceRow) { protected void merge(Row sourceRow) {
// put the column values into the table filter // put the column values into the table filter
......
...@@ -1485,6 +1485,7 @@ public class TransactionStore { ...@@ -1485,6 +1485,7 @@ public class TransactionStore {
* Iterate over entries. * Iterate over entries.
* *
* @param from the first key to return * @param from the first key to return
* @param to the last key to return
* @return the iterator * @return the iterator
*/ */
public Iterator<Entry<K, V>> entryIterator(final K from, final K to) { public Iterator<Entry<K, V>> entryIterator(final K from, final K to) {
......
...@@ -662,6 +662,12 @@ public class Schema extends DbObjectBase { ...@@ -662,6 +662,12 @@ public class Schema extends DbObjectBase {
} }
} }
/**
* Add a table synonym to the schema.
*
* @param data the create synonym information
* @return the created {@link TableSynonym} object
*/
public TableSynonym createSynonym(CreateSynonymData data) { public TableSynonym createSynonym(CreateSynonymData data) {
synchronized (database) { synchronized (database) {
database.lockMeta(data.session); database.lockMeta(data.session);
......
...@@ -20,6 +20,9 @@ public class TableSynonym extends SchemaObjectBase { ...@@ -20,6 +20,9 @@ public class TableSynonym extends SchemaObjectBase {
private CreateSynonymData data; private CreateSynonymData data;
/**
* The table the synonym is created for.
*/
private Table synonymFor; private Table synonymFor;
public TableSynonym(CreateSynonymData data) { public TableSynonym(CreateSynonymData data) {
...@@ -27,6 +30,9 @@ public class TableSynonym extends SchemaObjectBase { ...@@ -27,6 +30,9 @@ public class TableSynonym extends SchemaObjectBase {
this.data = data; this.data = data;
} }
/**
* @return the table this is a synonym for
*/
public Table getSynonymFor() { public Table getSynonymFor() {
return synonymFor; return synonymFor;
} }
...@@ -70,19 +76,30 @@ public class TableSynonym extends SchemaObjectBase { ...@@ -70,19 +76,30 @@ public class TableSynonym extends SchemaObjectBase {
throw DbException.getUnsupportedException("SYNONYM"); throw DbException.getUnsupportedException("SYNONYM");
} }
/**
* @return the table this synonym is for
*/
public String getSynonymForName() { public String getSynonymForName() {
return data.synonymFor; return data.synonymFor;
} }
/**
* @return the schema this synonym is for
*/
public Schema getSynonymForSchema() { public Schema getSynonymForSchema() {
return data.synonymForSchema; return data.synonymForSchema;
} }
/**
* @return true if this synonym currently points to a real table
*/
public boolean isInvalid() { public boolean isInvalid() {
return synonymFor.isValid(); return synonymFor.isValid();
} }
/**
* Update the table that this is a synonym for, to know about this synonym.
*/
public void updateSynonymFor() { public void updateSynonymFor() {
if (synonymFor != null) { if (synonymFor != null) {
synonymFor.removeSynonym(this); synonymFor.removeSynonym(this);
......
...@@ -19,7 +19,6 @@ import java.sql.SQLException; ...@@ -19,7 +19,6 @@ import java.sql.SQLException;
import java.sql.Time; import java.sql.Time;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.sql.Types; import java.sql.Types;
import org.h2.api.ErrorCode; import org.h2.api.ErrorCode;
import org.h2.engine.Mode; import org.h2.engine.Mode;
import org.h2.engine.SysProperties; import org.h2.engine.SysProperties;
...@@ -488,6 +487,7 @@ public abstract class Value { ...@@ -488,6 +487,7 @@ public abstract class Value {
/** /**
* Get the input stream * Get the input stream
*
* @param oneBasedOffset the offset (1 means no offset) * @param oneBasedOffset the offset (1 means no offset)
* @param length the requested length * @param length the requested length
* @return the new input stream * @return the new input stream
...@@ -503,6 +503,13 @@ public abstract class Value { ...@@ -503,6 +503,13 @@ public abstract class Value {
return new StringReader(getString()); return new StringReader(getString());
} }
/**
* Get the reader
*
* @param oneBasedOffset the offset (1 means no offset)
* @param length the requested length
* @return the new reader
*/
public Reader getReader(long oneBasedOffset, long length) { public Reader getReader(long oneBasedOffset, long length) {
String string = getString(); String string = getString();
long zeroBasedOffset = oneBasedOffset - 1; long zeroBasedOffset = oneBasedOffset - 1;
...@@ -609,6 +616,7 @@ public abstract class Value { ...@@ -609,6 +616,7 @@ public abstract class Value {
* the precision plays no role when converting the value * the precision plays no role when converting the value
* @param column the column that contains the ENUM datatype enumerators, * @param column the column that contains the ENUM datatype enumerators,
* for dealing with ENUM conversions * for dealing with ENUM conversions
* @param mode the database mode
* @return the converted value * @return the converted value
*/ */
public Value convertTo(int targetType, int precision, Mode mode, Column column) { public Value convertTo(int targetType, int precision, Mode mode, Column column) {
......
...@@ -80,6 +80,15 @@ public class ValueLob extends Value { ...@@ -80,6 +80,15 @@ public class ValueLob extends Value {
} }
} }
/**
* Create a reader that is s subset of the given reader.
*
* @param reader the input reader
* @param oneBasedOffset the offset (1 means no offset)
* @param length the length of the result, in bytes
* @param dataSize the length of the input, in bytes
* @return the smaller input stream
*/
static Reader rangeReader(Reader reader, long oneBasedOffset, long length, long dataSize) { static Reader rangeReader(Reader reader, long oneBasedOffset, long length, long dataSize) {
if (dataSize > 0) if (dataSize > 0)
rangeCheck(oneBasedOffset - 1, length, dataSize); rangeCheck(oneBasedOffset - 1, length, dataSize);
...@@ -486,6 +495,12 @@ public class ValueLob extends Value { ...@@ -486,6 +495,12 @@ public class ValueLob extends Value {
* except when converting to BLOB or CLOB. * except when converting to BLOB or CLOB.
* *
* @param t the new type * @param t the new type
* @param precision the precision of the column to convert this value to.
* The special constant <code>-1</code> is used to indicate that
* the precision plays no role when converting the value
* @param mode the database mode
* @param column the column that contains the ENUM datatype enumerators,
* for dealing with ENUM conversions
* @return the converted value * @return the converted value
*/ */
@Override @Override
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
package org.h2.value; package org.h2.value;
import java.util.Arrays; import java.util.Arrays;
import org.h2.engine.Mode; import org.h2.engine.Mode;
import org.h2.engine.SysProperties; import org.h2.engine.SysProperties;
import org.h2.util.StringUtils; import org.h2.util.StringUtils;
...@@ -89,6 +88,7 @@ public class ValueStringFixed extends ValueString { ...@@ -89,6 +88,7 @@ public class ValueStringFixed extends ValueString {
* be padded, this defines the overall length of the (potentially padded) string. * be padded, this defines the overall length of the (potentially padded) string.
* If the special constant {@link #PRECISION_DO_NOT_TRIM} is used the value will * If the special constant {@link #PRECISION_DO_NOT_TRIM} is used the value will
* not be trimmed. * not be trimmed.
* @param mode the database mode
* @return the value * @return the value
*/ */
public static ValueStringFixed get(String s, int precision, Mode mode) { public static ValueStringFixed get(String s, int precision, Mode mode) {
......
...@@ -1658,7 +1658,7 @@ public class TestFunctions extends TestBase implements AggregateFunction { ...@@ -1658,7 +1658,7 @@ public class TestFunctions extends TestBase implements AggregateFunction {
conn.close(); conn.close();
} }
String stripTrailingPeriod(String expected) { private static String stripTrailingPeriod(String expected) {
// CLDR provider appends period on some locales // CLDR provider appends period on some locales
int l = expected.length() - 1; int l = expected.length() - 1;
if (expected.charAt(l) == '.') if (expected.charAt(l) == '.')
......
...@@ -14,7 +14,6 @@ import java.util.HashMap; ...@@ -14,7 +14,6 @@ import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Random; import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import org.h2.api.ErrorCode; import org.h2.api.ErrorCode;
import org.h2.result.SortOrder; import org.h2.result.SortOrder;
import org.h2.test.TestBase; import org.h2.test.TestBase;
...@@ -263,7 +262,7 @@ public class TestIndex extends TestBase { ...@@ -263,7 +262,7 @@ public class TestIndex extends TestBase {
c.close(); c.close();
} }
void testConcurrentUpdateRun(ConcurrentUpdateThread[] threads, PreparedStatement check) throws SQLException { private void testConcurrentUpdateRun(ConcurrentUpdateThread[] threads, PreparedStatement check) throws SQLException {
for (ConcurrentUpdateThread t : threads) { for (ConcurrentUpdateThread t : threads) {
t.start(); t.start();
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论