To create a counter, the user must call the constructor with a start value, increment and optionally a final value. In addition the caller must specify the schema name, table name and column name uniquely identifying the counter.
When a counter is created it is in an invalid state-- to initialize it, the user must call either update or reset(false). The value of a counter can be changed by either calling reset or update.
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private int | |
| private long | |
| private long | |
| private String | |
| private long | |
| private boolean | |
| private String | |
| private Long | |
| private String |
| Access | Constructor and Description |
|---|---|
| public | AutoincrementCounter(Long
The start value of the counter; is a java object as
it can also be null. start, long how much to increment the counter by. increment, long the finalvalue of the counter. used by reset finalValue, String s, String t, String c, int position)constructor |
| Modifier and Type | Method and Description |
|---|---|
| public void | flushToDisk(TransactionController
TransactionController to use tc, DataDictionary DataDictionary to use. dd, UUID I might have the table name but I need more
information tableUUID)flush a counter to disk; i.e write the current value of the counter into the row in SYSCOLUMNS. |
| public int | Returns: the position of the corresponding column in the table (1-based)get the column position in the table for which this counter has been created. |
| public Long | |
| public String | |
| public Long | |
| public static String | |
| public static String | |
| public void | reset(boolean
if TRUE reset to beginning and mark it uninitialized. begin)reset to the counter to the beginning or the end. |
| public String | |
| public long | |
| public long |
| columnName | back to summary |
|---|---|
| private String columnName | |
| columnPosition | back to summary |
|---|---|
| private int columnPosition | |
| counter | back to summary |
|---|---|
| private long counter | |
| finalValue | back to summary |
|---|---|
| private long finalValue | |
| identity | back to summary |
|---|---|
| private String identity | |
| increment | back to summary |
|---|---|
| private long increment | |
| initialized | back to summary |
|---|---|
| private boolean initialized | |
| schemaName | back to summary |
|---|---|
| private String schemaName | |
| start | back to summary |
|---|---|
| private Long start | |
| tableName | back to summary |
|---|---|
| private String tableName | |
| AutoincrementCounter | back to summary |
|---|---|
| public AutoincrementCounter(Long start, long increment, long finalValue, String s, String t, String c, int position) constructor
| |
| flushToDisk | back to summary |
|---|---|
| public void flushToDisk(TransactionController tc, DataDictionary dd, UUID tableUUID) throws StandardException flush a counter to disk; i.e write the current value of the counter into the row in SYSCOLUMNS.
| |
| getColumnPosition | back to summary |
|---|---|
| public int getColumnPosition() get the column position in the table for which this counter has been created.
| |
| getCurrentValue | back to summary |
|---|---|
| public Long getCurrentValue() get the current value of the counter. An uninitialized counter means the current value is NULL. | |
| getIdentity | back to summary |
|---|---|
| public String getIdentity() return the identity of the counter. | |
| getStartValue | back to summary |
|---|---|
| public Long getStartValue() get the start value
| |
| makeIdentity | back to summary |
|---|---|
| public static String makeIdentity(String s, String t, String c) make a unique key for the counter. | |
| makeIdentity | back to summary |
|---|---|
| public static String makeIdentity(TableDescriptor td, ColumnDescriptor cd) make a unique key for the counter. | |
| reset | back to summary |
|---|---|
| public void reset(boolean begin) reset to the counter to the beginning or the end.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| update | back to summary |
|---|---|
| public long update(long t) update the counter.
| |
| update | back to summary |
|---|---|
| public long update() throws StandardException update the counter to its next value.
| |