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

improve javadoc

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