| Constructor and Description |
|---|
StorableIndex(java.lang.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.
|
| Modifier and Type | Method and Description |
|---|---|
StorableIndex<S> |
addProperty(StorableProperty<S> property,
Direction direction)
Returns a StorableIndex with the given property added.
|
void |
appendTo(java.lang.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(java.lang.Object obj) |
java.lang.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.
|
java.lang.Class<S> |
getStorableType()
Returns the type of storable this index applies to.
|
java.lang.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 <S extends Storable> |
parseNameDescriptor(java.lang.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.
|
java.lang.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.
|
public StorableIndex(StorableProperty<S>[] properties, Direction[] directions)
java.lang.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 directionjava.lang.IllegalArgumentException - if key is null or it has
no propertiespublic StorableIndex(OrderedProperty<S>[] properties, Direction direction)
direction - optional direction to apply to each property that
has an unspecified directionjava.lang.IllegalArgumentException - if no properties suppliedpublic StorableIndex(java.lang.Class<S> type, IndexInfo indexInfo)
type - type of storable index is defined forindexInfo - IndexInfo returned from storage objectjava.lang.IllegalArgumentException - if any argument is null, if any
properties are invalid, or if index info has no propertiespublic static <S extends Storable> StorableIndex<S> parseNameDescriptor(java.lang.String desc, StorableInfo<S> info) throws java.lang.IllegalArgumentException
desc - name descriptor, as created by getNameDescriptor()info - info on storable typejava.lang.IllegalArgumentException - if error in descriptor syntax or if it
refers to unknown propertiespublic java.lang.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 directionspublic StorableIndex<S> addProperty(StorableProperty<S> property, Direction direction)
property - property to add unless already in this indexdirection - direction to apply to property, if addedpublic StorableIndex<S> uniquify(StorableKey<S> key)
public java.lang.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
public java.lang.String getTypeDescriptor()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic void appendTo(java.lang.Appendable app)
throws java.io.IOException
Copyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.