public class StorableIndexSet<S extends Storable> extends java.util.TreeSet<StorableIndex<S>>
StorableIndex
objects, intended for reducing the
set such that the minimal amount of physical indexes need to be defined for
a specific type of Storable
.Constructor and Description |
---|
StorableIndexSet() |
StorableIndexSet(StorableIndexSet<S> set)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAlternateKeys(StorableInfo<S> info)
Adds all of the alternate keys of the given storable as indexes by
calling
addKey . |
void |
addIndexes(StorableInfo<S> info)
Adds all the indexes of the given storable.
|
void |
addIndexes(StorableInfo<S> info,
Direction defaultDirection)
Adds all the indexes of the given storable.
|
void |
addKey(StorableKey<S> key)
Adds the key as a unique index, preserving the property arrangement.
|
void |
addPrimaryKey(StorableInfo<S> info)
Adds the primary key of the given storable as indexes by calling
addKey . |
StorableIndex<S> |
findKeyIndex(StorableKey<S> key)
Finds the best index to represent the given key.
|
StorableIndex<S> |
findPrimaryKeyIndex(StorableInfo<S> info)
Finds the best index to represent the primary key.
|
void |
markClustered(boolean clustered)
Marks all indexes as clustered or non-clustered.
|
void |
reduce()
Reduces the size of the set by removing redundant indexes, and merges
others together.
|
void |
reduce(Direction defaultDirection)
Reduces the size of the set by removing redundant indexes, and merges
others together.
|
void |
setDefaultDirection(Direction defaultDirection)
Set the default direction for all index properties.
|
void |
uniquify(StorableInfo<S> info)
Augment non-unique indexes with primary key properties, thus making them
unique.
|
void |
uniquify(StorableKey<S> key)
Augment non-unique indexes with key properties, thus making them unique.
|
add, addAll, ceiling, clear, clone, comparator, contains, descendingIterator, descendingSet, first, floor, headSet, headSet, higher, isEmpty, iterator, last, lower, pollFirst, pollLast, remove, size, subSet, subSet, tailSet, tailSet
containsAll, retainAll, toArray, toArray, toString
public StorableIndexSet()
public StorableIndexSet(StorableIndexSet<S> set)
public void addIndexes(StorableInfo<S> info)
java.lang.IllegalArgumentException
- if info is nullpublic void addIndexes(StorableInfo<S> info, Direction defaultDirection)
defaultDirection
- default ordering direction to apply to each
index propertyjava.lang.IllegalArgumentException
- if any argument is nullpublic void addAlternateKeys(StorableInfo<S> info)
addKey
.java.lang.IllegalArgumentException
- if info is nullpublic void addPrimaryKey(StorableInfo<S> info)
addKey
. This method should not be called if the primary key
cannot be altered because persistent data is already stored against
it. Instead, the primary key index should be added as a normal index.
After adding the primary key via this method and after reducing the
set, call findPrimaryKeyIndex
to get the
best index to represent the primary key.
java.lang.IllegalArgumentException
- if info is nullpublic void addKey(StorableKey<S> key)
java.lang.IllegalArgumentException
- if key is nullpublic void reduce()
public void reduce(Direction defaultDirection)
defaultDirection
- replace unspecified property directions with thispublic void setDefaultDirection(Direction defaultDirection)
defaultDirection
- replace unspecified property directions with thispublic void markClustered(boolean clustered)
clustered
- true to mark clustered; false to mark non-clusteredStorableIndex.isClustered()
public void uniquify(StorableInfo<S> info)
java.lang.IllegalArgumentException
- if info is nullpublic void uniquify(StorableKey<S> key)
java.lang.IllegalArgumentException
- if key is nullpublic StorableIndex<S> findPrimaryKeyIndex(StorableInfo<S> info)
addPrimaryKey
, this method should never return null.java.lang.IllegalArgumentException
- if info is nullpublic StorableIndex<S> findKeyIndex(StorableKey<S> key)
addKey
,
this method should never return null.java.lang.IllegalArgumentException
- if key is nullCopyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.