Package guideme.indices
Class UniqueIndex<K,V>
java.lang.Object
guideme.indices.UniqueIndex<K,V>
- All Implemented Interfaces:
PageIndex
- Direct Known Subclasses:
ItemIndex
Maintains an index for any given page using a mapping function for keys and values of the index.
-
Nested Class Summary
Nested classes/interfaces inherited from interface guideme.indices.PageIndex
PageIndex.JsonSerializer<T>
-
Constructor Summary
ConstructorDescriptionUniqueIndex
(String name, UniqueIndex.EntryFunction<K, V> entryFunction, PageIndex.JsonSerializer<K> keySerializer, PageIndex.JsonSerializer<V> valueSerializer) -
Method Summary
Modifier and TypeMethodDescriptionvoid
export
(com.google.gson.stream.JsonWriter writer) Serialize the index to JSON for export to the website.getName()
void
rebuild
(List<ParsedGuidePage> pages) Fully rebuilds this index.boolean
void
update
(List<ParsedGuidePage> allPages, List<GuidePageChange> changes) Applies an incremental update to this index.
-
Constructor Details
-
UniqueIndex
public UniqueIndex(String name, UniqueIndex.EntryFunction<K, V> entryFunction, PageIndex.JsonSerializer<K> keySerializer, PageIndex.JsonSerializer<V> valueSerializer)
-
-
Method Details
-
getName
-
get
-
supportsUpdate
public boolean supportsUpdate()- Specified by:
supportsUpdate
in interfacePageIndex
- Returns:
- True if this index supports incremental updates via the
PageIndex.update(java.util.List<guideme.compiler.ParsedGuidePage>, java.util.List<guideme.GuidePageChange>)
method.
-
rebuild
Description copied from interface:PageIndex
Fully rebuilds this index. -
update
Description copied from interface:PageIndex
Applies an incremental update to this index. -
export
Description copied from interface:PageIndex
Serialize the index to JSON for export to the website.- Specified by:
export
in interfacePageIndex
- Throws:
IOException
-