|
|||||||||
| Home >> All >> org >> apache >> derby >> catalog >> [ types overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.derby.catalog.types
Class IndexDescriptorImpl

java.lang.Objectorg.apache.derby.catalog.types.IndexDescriptorImpl
- All Implemented Interfaces:
- java.io.Externalizable, org.apache.derby.iapi.services.io.Formatable, org.apache.derby.catalog.IndexDescriptor, java.io.Serializable, org.apache.derby.iapi.services.io.TypedFormat
- public class IndexDescriptorImpl
- extends java.lang.Object
- implements org.apache.derby.catalog.IndexDescriptor, org.apache.derby.iapi.services.io.Formatable
- extends java.lang.Object
| Field Summary | |
private int[] |
baseColumnPositions
|
private java.lang.String |
indexType
|
private boolean[] |
isAscending
|
private boolean |
isUnique
This class implements Formatable. |
private int |
numberOfOrderedColumns
|
| Constructor Summary | |
IndexDescriptorImpl()
Zero-argument constructor for Formatable interface |
|
IndexDescriptorImpl(java.lang.String indexType,
boolean isUnique,
int[] baseColumnPositions,
boolean[] isAscending,
int numberOfOrderedColumns)
Constructor for an IndexDescriptorImpl |
|
| Method Summary | |
int[] |
baseColumnPositions()
Returns an array of column positions in the base table. |
boolean |
equals(java.lang.Object other)
Test for value equality |
int |
getKeyColumnPosition(int heapColumnPosition)
Returns the postion of a column. |
java.lang.Integer |
getKeyColumnPosition(java.lang.Integer heapColumnPosition)
Returns the postion of a column. |
int |
getTypeFormatId()
Get a universally unique identifier for the type of this object. |
int |
hashCode()
Get a value that represents this Object, as uniquely as possible within the confines of an int. |
java.lang.String |
indexType()
Returns the type of the index. |
boolean[] |
isAscending()
Returns array of boolean telling asc/desc info for each index key column for convenience of using together with baseColumnPositions method. |
boolean |
isAscending(java.lang.Integer keyColumnPosition)
Returns true if the specified column is ascending in the index (1-based). |
boolean |
isDescending(java.lang.Integer keyColumnPosition)
Returns true if the specified column is descending in the index (1-based). |
boolean |
isUnique()
Returns true if the index is unique. |
int |
numberOfOrderedColumns()
Returns the number of ordered columns. |
void |
readExternal(java.io.ObjectInput in)
This method restores an object's state by reading in the instance data for the object from the passed in stream. |
void |
setBaseColumnPositions(int[] baseColumnPositions)
set the baseColumnPositions field of the index descriptor. |
void |
setIsAscending(boolean[] isAscending)
set the isAscending field of the index descriptor. |
void |
setNumberOfOrderedColumns(int numberOfOrderedColumns)
set the numberOfOrderedColumns field of the index descriptor. |
java.lang.String |
toString()
Convert this Object to a human-readable String. |
void |
writeExternal(java.io.ObjectOutput out)
This method is responsible for writing the instance data of an object to the passed in stream. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
isUnique
private boolean isUnique
- This class implements Formatable. That means that it
can write itself to and from a formatted stream. If
you add more fields to this class, make sure that you
also write/read them with the writeExternal()/readExternal()
methods.
If, inbetween releases, you add more fields to this class,
then you should bump the version number emitted by the getTypeFormatId()
method.
baseColumnPositions
private int[] baseColumnPositions
isAscending
private boolean[] isAscending
numberOfOrderedColumns
private int numberOfOrderedColumns
indexType
private java.lang.String indexType
| Constructor Detail |
IndexDescriptorImpl
public IndexDescriptorImpl(java.lang.String indexType, boolean isUnique, int[] baseColumnPositions, boolean[] isAscending, int numberOfOrderedColumns)
- Constructor for an IndexDescriptorImpl
IndexDescriptorImpl
public IndexDescriptorImpl()
- Zero-argument constructor for Formatable interface
| Method Detail |
isUnique
public boolean isUnique()
- Description copied from interface:
org.apache.derby.catalog.IndexDescriptor - Returns true if the index is unique.
- Specified by:
isUniquein interfaceorg.apache.derby.catalog.IndexDescriptor
baseColumnPositions
public int[] baseColumnPositions()
- Description copied from interface:
org.apache.derby.catalog.IndexDescriptor - Returns an array of column positions in the base table. Each index
column corresponds to a column position in the base table, except
the column representing the location of the row in the base table.
The returned array holds the column positions in the
base table, so, if entry 2 is the number 4, the second
column in the index is the fourth column in the table.
- Specified by:
baseColumnPositionsin interfaceorg.apache.derby.catalog.IndexDescriptor
getKeyColumnPosition
public java.lang.Integer getKeyColumnPosition(java.lang.Integer heapColumnPosition)
- Description copied from interface:
org.apache.derby.catalog.IndexDescriptor - Returns the postion of a column.
Returns the position of a column within the key (1-based). 0 means that the column is not in the key.
- Specified by:
getKeyColumnPositionin interfaceorg.apache.derby.catalog.IndexDescriptor
getKeyColumnPosition
public int getKeyColumnPosition(int heapColumnPosition)
- Description copied from interface:
org.apache.derby.catalog.IndexDescriptor - Returns the postion of a column.
Returns the position of a column within the key (1-based). 0 means that the column is not in the key. Same as the above method, but it uses int instead of Integer.
- Specified by:
getKeyColumnPositionin interfaceorg.apache.derby.catalog.IndexDescriptor
numberOfOrderedColumns
public int numberOfOrderedColumns()
- Description copied from interface:
org.apache.derby.catalog.IndexDescriptor - Returns the number of ordered columns.
In the future, it will be possible to store non-ordered columns in an index. These will be useful for covered queries. The ordered columns will be at the beginning of the index row, and they will be followed by the non-ordered columns. For now, all columns in an index must be ordered.
- Specified by:
numberOfOrderedColumnsin interfaceorg.apache.derby.catalog.IndexDescriptor
indexType
public java.lang.String indexType()
- Description copied from interface:
org.apache.derby.catalog.IndexDescriptor - Returns the type of the index. For now, we only support B-Trees,
so the value "BTREE" is returned.
- Specified by:
indexTypein interfaceorg.apache.derby.catalog.IndexDescriptor
isAscending
public boolean isAscending(java.lang.Integer keyColumnPosition)
- Description copied from interface:
org.apache.derby.catalog.IndexDescriptor - Returns true if the specified column is ascending in the index
(1-based).
- Specified by:
isAscendingin interfaceorg.apache.derby.catalog.IndexDescriptor
isDescending
public boolean isDescending(java.lang.Integer keyColumnPosition)
- Description copied from interface:
org.apache.derby.catalog.IndexDescriptor - Returns true if the specified column is descending in the index
(1-based). In the current release, only ascending columns are
supported.
- Specified by:
isDescendingin interfaceorg.apache.derby.catalog.IndexDescriptor
isAscending
public boolean[] isAscending()
- Description copied from interface:
org.apache.derby.catalog.IndexDescriptor - Returns array of boolean telling asc/desc info for each index
key column for convenience of using together with baseColumnPositions
method. Both methods return an array with subscript starting from 0.
- Specified by:
isAscendingin interfaceorg.apache.derby.catalog.IndexDescriptor
setBaseColumnPositions
public void setBaseColumnPositions(int[] baseColumnPositions)
- Description copied from interface:
org.apache.derby.catalog.IndexDescriptor - set the baseColumnPositions field of the index descriptor. This
is for updating the field in operations such as "alter table drop
column" where baseColumnPositions is changed.
- Specified by:
setBaseColumnPositionsin interfaceorg.apache.derby.catalog.IndexDescriptor
setIsAscending
public void setIsAscending(boolean[] isAscending)
- Description copied from interface:
org.apache.derby.catalog.IndexDescriptor - set the isAscending field of the index descriptor. This
is for updating the field in operations such as "alter table drop
column" where isAscending is changed.
- Specified by:
setIsAscendingin interfaceorg.apache.derby.catalog.IndexDescriptor
setNumberOfOrderedColumns
public void setNumberOfOrderedColumns(int numberOfOrderedColumns)
- Description copied from interface:
org.apache.derby.catalog.IndexDescriptor - set the numberOfOrderedColumns field of the index descriptor. This
is for updating the field in operations such as "alter table drop
column" where numberOfOrderedColumns is changed.
- Specified by:
setNumberOfOrderedColumnsin interfaceorg.apache.derby.catalog.IndexDescriptor
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object - Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string concatenation with this object. If the result is
null, string concatenation will instead use"null".The default implementation returns
getClass().getName() + "@" + Integer.toHexString(hashCode()).
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
- Description copied from interface:
java.io.Externalizable - This method restores an object's state by reading in the instance data
for the object from the passed in stream. Note that this stream is not
a subclass of
InputStream, but rather is a class that implements theObjectInputinterface. That interface provides a mechanism for reading in Java data types from a stream.Note that this method must be compatible with
writeExternal. It must read back the exact same types that were written by that method in the exact order they were written.If this method needs to read back an object instance, then the class for that object must be found and loaded. If that operation fails, then this method throws a
ClassNotFoundException- Specified by:
readExternalin interfacejava.io.Externalizable
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
- Description copied from interface:
java.io.Externalizable - This method is responsible for writing the instance data of an object
to the passed in stream. Note that this stream is not a subclass of
OutputStream, but rather is a class that implements theObjectOutputinterface. That interface provides a number of methods for writing Java data values to a stream.Not that the implementation of this method must be coordinated with the implementation of
readExternal.- Specified by:
writeExternalin interfacejava.io.Externalizable
getTypeFormatId
public int getTypeFormatId()
- Description copied from interface:
org.apache.derby.iapi.services.io.TypedFormat - Get a universally unique identifier for the type of
this object.
- Specified by:
getTypeFormatIdin interfaceorg.apache.derby.iapi.services.io.TypedFormat
equals
public boolean equals(java.lang.Object other)
- Test for value equality
hashCode
public int hashCode()
- Description copied from class:
java.lang.Object - Get a value that represents this Object, as uniquely as
possible within the confines of an int.
There are some requirements on this method which subclasses must follow:
- Semantic equality implies identical hashcodes. In other
words, if
a.equals(b)is true, thena.hashCode() == b.hashCode()must be as well. However, the reverse is not necessarily true, and two objects may have the same hashcode without being equal. - It must be consistent. Whichever value o.hashCode() returns on the first invocation must be the value returned on all later invocations as long as the object exists. Notice, however, that the result of hashCode may change between separate executions of a Virtual Machine, because it is not invoked on the same object.
Notice that since
hashCodeis used in java.util.Hashtable and other hashing classes, a poor implementation will degrade the performance of hashing (so don't blindly implement it as returning a constant!). Also, if calculating the hash is time-consuming, a class may consider caching the results.The default implementation returns
System.identityHashCode(this) - Semantic equality implies identical hashcodes. In other
words, if
|
|||||||||
| Home >> All >> org >> apache >> derby >> catalog >> [ types overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.apache.derby.catalog.types.IndexDescriptorImpl