Package guideme.indices
Class MultiValuedIndex<K,V>
java.lang.Object
guideme.indices.MultiValuedIndex<K,V>
- All Implemented Interfaces:
PageIndex
- Direct Known Subclasses:
CategoryIndex
A convenient index base-class for indices that map keys to multiple pages.
-
Nested Class Summary
Nested classes/interfaces inherited from interface guideme.indices.PageIndex
PageIndex.JsonSerializer<T>
-
Constructor Summary
ConstructorDescriptionMultiValuedIndex
(String name, MultiValuedIndex.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
-
MultiValuedIndex
public MultiValuedIndex(String name, MultiValuedIndex.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
-