| java.lang.Object org.netbeans.modules.sql.framework.model.impl.IndexImpl
IndexImpl | public class IndexImpl implements Cloneable,Index(Code) | | Implements Index interface.
author: Jonathan Giron version: $Revision$ |
Inner Class :public static class Column implements Comparable | |
Constructor Summary | |
| IndexImpl(ResultSet rs) | public | IndexImpl(Element keyElement) Creates a new instance of IndexImpl, using the given keyElement as a source for
reconstituting its contents. | public | IndexImpl(Index src) Creates a new instance of Index, cloning the contents of the given Index
implementation instance. | public | IndexImpl(String indexName, int indexType, boolean isUnique, String sortOrder, int indexCardinality) Creates a new instance of Index with the given key name and attributes. | public | IndexImpl(String indexName, int indexType, boolean isUnique, String sortOrder, int indexCardinality, List indexColumnNames, boolean isStringList) Creates a new instance of Index with the given key name and attributes, and
referencing the column names in the given List. |
CARDINALITY_ATTR | final public static String CARDINALITY_ATTR(Code) | | Name of attribute used for marshalling out cardinality value to XML
|
COLUMNS_ATTR | final public static String COLUMNS_ATTR(Code) | | List of column names in key sequence order.
|
ELEMENT_TAG | final public static String ELEMENT_TAG(Code) | | Document element tag name for marshalling out this object to XML
|
NAME_ATTR | final public static String NAME_ATTR(Code) | | Name of attribute used for marshalling out index name to XML
|
SORTORDER_ATTR | final public static String SORTORDER_ATTR(Code) | | Name of attribute used for marshalling out sort order value to XML
|
TYPE_ATTR | final public static String TYPE_ATTR(Code) | | Name of attribute used for marshalling out index type to XML
|
UNIQUE_ATTR | final public static String UNIQUE_ATTR(Code) | | Name of attribute used for marshalling out uniqueness flag to XML
|
IndexImpl | public IndexImpl(Element keyElement)(Code) | | Creates a new instance of IndexImpl, using the given keyElement as a source for
reconstituting its contents. Caller must invoke parseXML() after this constructor
returns in order to unmarshal and reconstitute the instance object.
Parameters: keyElement - DOM element containing XML marshalled version of a IndexImplinstance See Also: IndexImpl.parseXML |
IndexImpl | public IndexImpl(Index src)(Code) | | Creates a new instance of Index, cloning the contents of the given Index
implementation instance.
Parameters: src - Index instance to be cloned |
IndexImpl | public IndexImpl(String indexName, int indexType, boolean isUnique, String sortOrder, int indexCardinality)(Code) | | Creates a new instance of Index with the given key name and attributes.
Parameters: indexName - name of this Index, must be non-empty Parameters: indexType - type of Index, as enumerated in java.sql.DatabaseMetaData; one oftableIndexClustered, tableIndexHashed, or tableIndexOther Parameters: isUnique - true if index enforces uniqueness, false otherwise Parameters: sortOrder - 'A' for ascending, 'D' for descending, null if undefined Parameters: indexCardinality - cardinality of this index See Also: java.sql.DatabaseMetaData.tableIndexClustered See Also: java.sql.DatabaseMetaData.tableIndexHashed See Also: java.sql.DatabaseMetaData.tableIndexOther |
IndexImpl | public IndexImpl(String indexName, int indexType, boolean isUnique, String sortOrder, int indexCardinality, List indexColumnNames, boolean isStringList)(Code) | | Creates a new instance of Index with the given key name and attributes, and
referencing the column names in the given List.
Parameters: indexName - name of this Index, must be non-empty Parameters: indexType - type of Index, as enumerated in java.sql.DatabaseMetaData; one oftableIndexClustered, tableIndexHashed, or tableIndexOther Parameters: isUnique - true if index enforces uniqueness, false otherwise Parameters: sortOrder - 'A' for ascending, 'D' for descending, null if undefined Parameters: indexCardinality - cardinality of this index Parameters: indexColumnNames - List of Column objects, or column names in sequentialorder, depending on state of isStringList Parameters: isStringList - true if indexColumnName contains column names in sequentialorder, false if it contains Column objects which need to be sorted insequential order. See Also: java.sql.DatabaseMetaData.tableIndexClustered See Also: java.sql.DatabaseMetaData.tableIndexHashed See Also: java.sql.DatabaseMetaData.tableIndexOther |
clone | public Object clone()(Code) | | Create a clone of this PrimaryKeyImpl.
cloned copy of DBColumn. |
contains | public boolean contains(DBColumn col)(Code) | | See Also: org.netbeans.modules.model.database.Index.contains(DBColumn) |
contains | public boolean contains(String columnName)(Code) | | See Also: org.netbeans.modules.model.database.Index.contains(java.lang.String) |
createIndexList | public static List<IndexImpl> createIndexList(ResultSet rs) throws SQLException(Code) | | Creates a List of IndexColumn instances from the given ResultSet.
Parameters: rs - ResultSet containing index metadata as obtained from DatabaseMetaData List of IndexColumn instances based from metadata in rs' throws: SQLException - if SQL error occurs while reading in data fromgiven ResultSet |
equals | public boolean equals(Object refObj)(Code) | | Overrides default implementation to return value based on memberwise comparison.
Parameters: refObj - Object against which we compare this instance true if refObj is functionally identical to this instance; false otherwise |
getCardinality | public int getCardinality()(Code) | | See Also: org.netbeans.modules.model.database.Index.getCardinality |
getColumnCount | public int getColumnCount()(Code) | | See Also: org.netbeans.modules.model.database.Index.getColumnCount |
getColumnName | public String getColumnName(int iColumn)(Code) | | See Also: org.netbeans.modules.model.database.Index.getColumnName |
getColumnNames | public List<String> getColumnNames()(Code) | | See Also: org.netbeans.modules.model.database.Index.getColumnNames |
getName | public String getName()(Code) | | See Also: org.netbeans.modules.model.database.Index.getName |
getParent | public DBTable getParent()(Code) | | See Also: org.netbeans.modules.model.database.Index.getParent |
getSequence | public int getSequence(DBColumn col)(Code) | | See Also: org.netbeans.modules.model.database.Index.getSequence(DBColumn) |
getSequence | public int getSequence(String columnName)(Code) | | Gets the ordinal position of the column, if any, associated with the given
columnName.
Parameters: columnName - name of column whose position is desired (zero-based) position of given column, or -1 if no column by the givencolumnName could be located |
getSortSequence | public String getSortSequence()(Code) | | See Also: org.netbeans.modules.model.database.Index.getSortSequence |
getType | public int getType()(Code) | | See Also: org.netbeans.modules.model.database.Index.getType |
hashCode | public int hashCode()(Code) | | Overrides default implementation to compute hashCode value for those members used
in equals() for comparison.
hash code for this object See Also: java.lang.Object.hashCode |
isUnique | public boolean isUnique()(Code) | | See Also: org.netbeans.modules.model.database.Index.contains(java.lang.String) |
parseXML | public void parseXML() throws BaseException(Code) | | Parses the XML content, if any, represented by the DOM element member variable.
exception: BaseException - thrown while parsing XML, or if member variable element isnull |
setColumnNames | public void setColumnNames(List<String> indexColumnNames, boolean isStringList)(Code) | | Sets column names associated with this index from the given List, using the given
flag to interpret the type of objects contained in the list.
Parameters: indexColumnNames - List of column names (either as Index.Column objects orString values) Parameters: isStringList - true if List contains column names as Strings, false if Listcontains Index.Column objects. |
setColumnNames | public void setColumnNames(String[] newColNames)(Code) | | Replaces the current List of column names with the contents of the given String
array.
Parameters: newColNames - array of names to supplant current list of column names |
setParent | public void setParent(DBTable newParent)(Code) | | Sets reference to SQLTable that owns this primary key.
Parameters: newParent - new parent of this primary key. |
toXMLString | public synchronized String toXMLString()(Code) | | Gets the default XML representation of index metadata.
XML representation of the index metadata. |
toXMLString | public synchronized String toXMLString(String prefix)(Code) | | Gets the XML representation of index metadata, using the given String as a prefix
for successive elements.
Parameters: prefix - start-of-line prefix for the XML representation. XML representation of the index metadata. |
|
|