public final class P2JIndexComponent
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static int |
ABBREVIATED
Flag indicating abbreviated status (Progress semantic)
|
private static int |
CHARACTER
Flag indicating component represents character data
|
static int |
COLUMN
Flag for namespaces supported by this object.
|
private java.lang.String |
columnName
Name of indexed database column (if available).
|
private static int |
DESCENDING
Flag indicating descending (non-default) sort direction
|
private int |
extent
Extent of the component (can be > 0 only for a word index component)
|
private int |
flags
Property flags
|
private int |
hash
Precomputed hash value.
|
private static int |
IGNORE_CASE
Flag indicating component ignores case (character data only)
|
static int |
LEGACY
Flag for namespaces supported by this object.
|
private java.lang.String |
legacyName
The legacy name of this component was built from (case sensitive), if available.
|
static int |
NORMALIZED
Flag for namespaces supported by this object.
|
private java.lang.String |
normalizedName
The legacy normalized name of this component was built from, if available.
|
static int |
PROPERTY
Flag for namespaces supported by this object.
|
private java.lang.String |
propertyName
Name of indexed property (if available).
|
Constructor and Description |
---|
P2JIndexComponent(P2JIndexComponent component)
Copy constructor.
|
P2JIndexComponent(java.lang.String legacy,
java.lang.String property,
java.lang.String column,
boolean descending,
boolean isChar,
boolean ignoreCase,
boolean abbreviated)
Constructor.
|
P2JIndexComponent(java.lang.String legacy,
java.lang.String property,
java.lang.String column,
int extent,
boolean descending,
boolean isChar,
boolean ignoreCase,
boolean abbreviated)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
checkNotNull(java.lang.String name,
java.lang.String space)
Checks whether the requested name is
null . |
boolean |
equals(java.lang.Object o)
Test for equivalence;
o is considered equivalent if it a Component instance with the same
name, sort direction, and abbreviation support as this component instance. |
java.lang.String |
getColumnName()
Get index component's column name.
|
int |
getExtent()
Get extent of the field.
|
java.lang.String |
getLegacyName()
Get index component legacy's original name (case-sensitive).
|
java.lang.String |
getName(int namespace)
Returns one of the known flavours of this component.
|
java.lang.String |
getNormalizedName()
Get index legacy's name (in lowercase).
|
java.lang.String |
getPropertyName()
Get index property's column name.
|
int |
hashCode()
Hash code implementation which is consistent with this class' implementation of
equals(java.lang.Object) . |
boolean |
isAbbreviated()
Indicate if index component supports Progress semantic of using
abbreviated data for a sort or selection match.
|
boolean |
isCharType()
Indicate if index component represents a character field.
|
boolean |
isDescending()
Indicate if index component uses descending (non-default) sort direction.
|
boolean |
isIgnoreCase()
Indicate if index component represents a character field and ignores case in data comparisons.
|
boolean |
sameAs(P2JIndexComponent other,
boolean direction)
Compare this object to another
P2JIndexComponent . |
java.lang.String |
toString()
Get a string representation of the internal state of this object, primarily for debugging purposes.
|
private static final int DESCENDING
private static final int CHARACTER
private static final int IGNORE_CASE
private static final int ABBREVIATED
private final java.lang.String propertyName
private final java.lang.String columnName
private final java.lang.String legacyName
private final java.lang.String normalizedName
private final int extent
public static final int LEGACY
public static final int PROPERTY
public static final int COLUMN
public static final int NORMALIZED
private final int flags
private final int hash
public P2JIndexComponent(java.lang.String legacy, java.lang.String property, java.lang.String column, int extent, boolean descending, boolean isChar, boolean ignoreCase, boolean abbreviated)
legacy
- The legacy name (optional).property
- Property name (optional).column
- Column name (optional).extent
- Extent of the component (can be > 0 only for a word index component).descending
- true
if component has non-default, descending sort direction; false
if
ascending.isChar
- true
if this component represents a character field.ignoreCase
- true
if this component represents a character field AND case is ignored when sorting
index, else false
.abbreviated
- true
if index component supports the Progress semantic of using abbreviated data for a
sort or selection match. Valid only if this is the last component of the index (not enforced
here).public P2JIndexComponent(P2JIndexComponent component)
component
- Instance to copy.public P2JIndexComponent(java.lang.String legacy, java.lang.String property, java.lang.String column, boolean descending, boolean isChar, boolean ignoreCase, boolean abbreviated)
legacy
- The legacy name (optional).property
- Property name (optional).column
- Column name (optional).descending
- true
if component has non-default, descending sort direction; false
if
ascending.isChar
- true
if this component represents a character field.ignoreCase
- true
if this component represents a character field AND case is ignored when sorting
index, else false
.abbreviated
- true
if index component supports the Progress semantic of using abbreviated data for a
sort or selection match. Valid only if this is the last component of the index (not enforced
here).public java.lang.String getName(int namespace)
namespace
- The flag for one of the namespace to be returned.java.lang.IllegalArgumentException
- if the parameter is not a simple namespace flag (no combinations allowed).java.lang.RuntimeException
- (temporary) If the requested name is not set. This normally point out a programming error
as the caller should know the namespace this object was constructed with and the name spaces
for them may be different (ex: Legacy: a-Field
, Property: aField
, SQL Column:
a_field
, Normalized legacy: a-field
).public java.lang.String getNormalizedName()
getLegacyName()
.public java.lang.String getLegacyName()
public java.lang.String getColumnName()
public java.lang.String getPropertyName()
public int getExtent()
public boolean isDescending()
true
if sort direction is descending, else false
if ascending.public boolean isCharType()
true
if case is ignored; else false
.public boolean isIgnoreCase()
true
if case is ignored; else false
.public boolean isAbbreviated()
true
if abbreviated match is supported, else false
.public boolean sameAs(P2JIndexComponent other, boolean direction)
P2JIndexComponent
. It is assumed both objects contains data in
same space names.other
- The P2JIndexComponent
object to compare to.direction
- If the direction should also be tested. If false
the direction is omitted.true
only if the two components represents the same field/property/column.public boolean equals(java.lang.Object o)
o
is considered equivalent if it a Component
instance with the same
name, sort direction, and abbreviation support as this component instance.equals
in class java.lang.Object
o
- An object instance, presumably a Component
object, to test for equivalence with this
object.true
if o
is equivalent to this instance, else false
.public int hashCode()
equals(java.lang.Object)
.hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
private void checkNotNull(java.lang.String name, java.lang.String space)
null
. An exception is thrown if the case.name
- The name to be checked.space
- The namespace. Used for constructing the exception message.java.lang.RuntimeException
- when the specified name is null
. The message of the exception will contain a
description of the internal structure to facilitate the dataflow and configured name-spaces.