Package adams.db.indices
Class IndexColumn
- java.lang.Object
-
- adams.db.indices.IndexColumn
-
public class IndexColumn extends Object
An IndexColumn holds the column name and whether ascending or descending ordering. For some keys, like text blobs, a length must be provided.- Version:
- $Revision$
- Author:
- dale
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_asc_or_desc
ascending or descending?protected String
m_columnName
column name.protected int
m_Length
the length of the key (e.g., for an index on a text blob).
-
Constructor Summary
Constructors Constructor Description IndexColumn(String cname)
Constructor.IndexColumn(String cname, boolean ascending)
Constructor.IndexColumn(String cname, boolean ascending, int length)
Constructor.IndexColumn(String cname, String asc_or_desc)
Constructor.IndexColumn(String cname, String asc_or_desc, int length)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(IndexColumn ic)
Return true if given IndexColumn matches this one.String
getAscOrDesc()
Returns the order string.String
getColumnName()
Returns the name of the column.int
getLength()
Returns the length of the key.String
toString(AbstractDatabaseConnection conn)
Return string representation.
-
-
-
Constructor Detail
-
IndexColumn
public IndexColumn(String cname)
Constructor. Default to ascending.- Parameters:
cname
- column name
-
IndexColumn
public IndexColumn(String cname, boolean ascending)
Constructor. Key length is -1.- Parameters:
cname
- columnascending
- ascending order?
-
IndexColumn
public IndexColumn(String cname, boolean ascending, int length)
Constructor.- Parameters:
cname
- columnascending
- ascending order?length
- the length of the key, use -1 to ignore
-
IndexColumn
public IndexColumn(String cname, String asc_or_desc)
Constructor. Key length is -1.- Parameters:
cname
- column nameasc_or_desc
- ordering string
-
-
Method Detail
-
getColumnName
public String getColumnName()
Returns the name of the column.- Returns:
- the name of the column
-
getAscOrDesc
public String getAscOrDesc()
Returns the order string.- Returns:
- the order string
-
getLength
public int getLength()
Returns the length of the key.- Returns:
- the key length
-
equals
public boolean equals(IndexColumn ic)
Return true if given IndexColumn matches this one.- Parameters:
ic
- IndexCOlumn to compare- Returns:
- equal?
-
toString
public String toString(AbstractDatabaseConnection conn)
Return string representation.- Returns:
- string representation
-
-