|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.amazon.carbonado.info.StorableIndex<S>
public class StorableIndex<S extends Storable>
Represents an index that must be defined for a specific Storable type.
Index| Constructor Summary | |
|---|---|
StorableIndex(Class<S> type,
IndexInfo indexInfo)
Creates a StorableIndex from an IndexInfo. |
|
StorableIndex(OrderedProperty<S>[] properties,
Direction direction)
Creates a StorableIndex from OrderedProperties. |
|
StorableIndex(StorableKey<S> key,
Direction direction)
Creates a StorableIndex from a StorableKey. |
|
StorableIndex(StorableProperty<S>[] properties,
Direction[] directions)
Creates a StorableIndex from the given properties and matching directions. |
|
StorableIndex(StorableProperty<S>[] properties,
Direction[] directions,
boolean unique)
Creates a StorableIndex from the given properties and matching directions. |
|
StorableIndex(StorableProperty<S>[] properties,
Direction[] directions,
boolean unique,
boolean clustered)
Creates a StorableIndex from the given properties and matching directions. |
|
| Method Summary | ||
|---|---|---|
StorableIndex<S> |
addProperty(StorableProperty<S> property,
Direction direction)
Returns a StorableIndex with the given property added. |
|
void |
appendTo(Appendable app)
Appends the same results as toString, but without the "StorableIndex" prefix. |
|
StorableIndex<S> |
clustered(boolean clustered)
Returns a StorableIndex instance which is clustered or not. |
|
boolean |
equals(Object obj)
|
|
String |
getNameDescriptor()
Converts this index into a parseable name descriptor string, whose general format is: |
|
OrderedProperty<S>[] |
getOrderedProperties()
Returns a new array with all the properties in it, with directions folded in. |
|
OrderedProperty<S> |
getOrderedProperty(int index)
Returns a specific property in this index, with the direction folded in. |
|
StorableProperty<S>[] |
getProperties()
Returns a new array with all the properties in it. |
|
StorableProperty<S> |
getProperty(int index)
Returns a specific property in this index. |
|
int |
getPropertyCount()
Returns the count of properties in this index. |
|
Direction |
getPropertyDirection(int index)
Returns the requested direction of a specific property in this index. |
|
Direction[] |
getPropertyDirections()
Returns a new array with all the property directions in it. |
|
Class<S> |
getStorableType()
Returns the type of storable this index applies to. |
|
String |
getTypeDescriptor()
Converts this index into a parseable type descriptor string, which basically consists of Java type descriptors appended together. |
|
int |
hashCode()
|
|
boolean |
isClustered()
Returns true if index is known to be clustered, which means it defines the physical ordering of storables. |
|
boolean |
isUnique()
|
|
static
|
parseNameDescriptor(String desc,
StorableInfo<S> info)
Parses an index descriptor and returns an index object. |
|
StorableIndex<S> |
reverse()
Returns a StorableIndex instance with all the properties reversed. |
|
StorableIndex<S> |
setDefaultDirection(Direction direction)
Returns a StorableIndex instance with all unspecified directions set to the given direction. |
|
String |
toString()
|
|
StorableIndex<S> |
unique(boolean unique)
Returns a StorableIndex instance which is unique or not. |
|
StorableIndex<S> |
uniquify(StorableKey<S> key)
Returns a StorableIndex which is unique, possibly by appending properties from the given key. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public StorableIndex(StorableProperty<S>[] properties,
Direction[] directions)
IllegalArgumentException - if any argument is null, if lengths
do not match, or if any length is zero.
public StorableIndex(StorableProperty<S>[] properties,
Direction[] directions,
boolean unique)
properties - directions - unique -
public StorableIndex(StorableProperty<S>[] properties,
Direction[] directions,
boolean unique,
boolean clustered)
properties - directions - unique - clustered -
public StorableIndex(StorableKey<S> key,
Direction direction)
direction - optional direction to apply to each key property that
has an unspecified direction
IllegalArgumentException - if key is null or it has
no properties
public StorableIndex(OrderedProperty<S>[] properties,
Direction direction)
direction - optional direction to apply to each property that
has an unspecified direction
IllegalArgumentException - if no properties supplied
public StorableIndex(Class<S> type,
IndexInfo indexInfo)
type - type of storable index is defined forindexInfo - IndexInfo returned from storage object
IllegalArgumentException - if any argument is null, if any
properties are invalid, or if index info has no properties| Method Detail |
|---|
public static <S extends Storable> StorableIndex<S> parseNameDescriptor(String desc,
StorableInfo<S> info)
throws IllegalArgumentException
desc - name descriptor, as created by getNameDescriptor()info - info on storable type
IllegalArgumentException - if error in descriptor syntax or if it
refers to unknown propertiespublic Class<S> getStorableType()
public int getPropertyCount()
public StorableProperty<S> getProperty(int index)
public StorableProperty<S>[] getProperties()
public Direction getPropertyDirection(int index)
public Direction[] getPropertyDirections()
public OrderedProperty<S> getOrderedProperty(int index)
public OrderedProperty<S>[] getOrderedProperties()
public boolean isUnique()
public boolean isClustered()
public StorableIndex<S> unique(boolean unique)
public StorableIndex<S> clustered(boolean clustered)
public StorableIndex<S> reverse()
public StorableIndex<S> setDefaultDirection(Direction direction)
direction - direction to replace all unspecified directions
public StorableIndex<S> addProperty(StorableProperty<S> property,
Direction direction)
property - property to add unless already in this indexdirection - direction to apply to property, if added
public StorableIndex<S> uniquify(StorableKey<S> key)
public String getNameDescriptor()
<storable type>~<attr><+|-|~><property><+|-|~><property>...
Attr is "U" for a unique index, "N" for a non-unique index.
Example: my.pkg.UserInfo~N+lastName+firstName-birthDate
parseNameDescriptor(String, StorableInfo)public String getTypeDescriptor()
public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic String toString()
toString in class Object
public void appendTo(Appendable app)
throws IOException
appendTo in interface Appenderapp - Appendable object to receive string representation
IOException - if thrown from given Appendable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||