Package org.rcsb.strucmotif.io
Class InvertedIndexImpl
java.lang.Object
org.rcsb.strucmotif.io.InvertedIndexImpl
- All Implemented Interfaces:
InvertedIndex
The implementation of the inverted index.
-
Constructor Summary
ConstructorsConstructorDescriptionInvertedIndexImpl(MotifSearchConfig motifSearchConfig) Construct a inverted index instance. -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(Collection<String> removals) Removes all information on a set of structures from the index.protected InputStreamgetInputStream(ResiduePairDescriptor residuePairDescriptor) Acquire the input stream for a descriptor.voidinsert(ResiduePairDescriptor residuePairDescriptor, Map<String, Collection<ResiduePairIdentifier>> residuePairOccurrences) Insert operation for new data.select(ResiduePairDescriptor residuePairDescriptor) Perform lookup for a particular bin.
-
Constructor Details
-
InvertedIndexImpl
Construct a inverted index instance.- Parameters:
motifSearchConfig- the config
-
-
Method Details
-
insert
public void insert(ResiduePairDescriptor residuePairDescriptor, Map<String, Collection<ResiduePairIdentifier>> residuePairOccurrences) Description copied from interface:InvertedIndexInsert operation for new data.- Specified by:
insertin interfaceInvertedIndex- Parameters:
residuePairDescriptor- the bin for which new data should be writtenresiduePairOccurrences- the data to append to this bin - keys are pdbIds, values are all words of this descriptor
-
select
public Stream<Pair<String,InvertedIndexResiduePairIdentifier[]>> select(ResiduePairDescriptor residuePairDescriptor) Description copied from interface:InvertedIndexPerform lookup for a particular bin.- Specified by:
selectin interfaceInvertedIndex- Parameters:
residuePairDescriptor- the bin for which occurrences should the lookup be performed- Returns:
- a
Streamof all occurrences, grouped by their structure identifier
-
getInputStream
protected InputStream getInputStream(ResiduePairDescriptor residuePairDescriptor) throws IOException Acquire the input stream for a descriptor.- Parameters:
residuePairDescriptor- the descriptor of interest- Returns:
- the corresponding input stream
- Throws:
IOException- reading failed
-
delete
Description copied from interface:InvertedIndexRemoves all information on a set of structures from the index.- Specified by:
deletein interfaceInvertedIndex- Parameters:
removals- what to remove
-