@SuppressWarnings("unchecked") @Override public PostingIndex<Pointer> getDirectIndex() { return (PostingIndex<Pointer>) getIndexStructure("direct"); }
@SuppressWarnings("unchecked") public <T> T getIndexStructure(String structureName, Class<? extends T> clazz) { return (T)getIndexStructure(structureName); } /**
@SuppressWarnings("unchecked") public <T> T getIndexStructure(String structureName, Class<? extends T> clazz) { return (T)getIndexStructure(structureName); } /**
@SuppressWarnings("unchecked") @Override public Lexicon<String> getLexicon() { return (Lexicon<String>) getIndexStructure("lexicon"); }
@SuppressWarnings("unchecked") @Override public PostingIndex<Pointer> getDirectIndex() { return (PostingIndex<Pointer>) getIndexStructure("direct"); }
@SuppressWarnings("unchecked") @Override public Lexicon<String> getLexicon() { return (Lexicon<String>) getIndexStructure("lexicon"); }
@Override public CollectionStatistics getCollectionStatistics() { return (CollectionStatistics) getIndexStructure("collectionstatistics"); }
@Override public DocumentIndex getDocumentIndex() { return (DocumentIndex) getIndexStructure("document"); }
@Override public DocumentIndex getDocumentIndex() { return (DocumentIndex) getIndexStructure("document"); }
@Override public PostingIndex<?> getInvertedIndex() { return (PostingIndex<?>) getIndexStructure("inverted"); }
@Override public CollectionStatistics getCollectionStatistics() { return (CollectionStatistics) getIndexStructure("collectionstatistics"); }
@Override public MetaIndex getMetaIndex() { return (MetaIndex) getIndexStructure("meta"); }
@SuppressWarnings("unchecked") public FSArrayFileInMem(IndexOnDisk index, String structureName) throws IOException { this( index.getPath() + "/" + index.getPrefix() + "." + structureName + FSArrayFile.USUAL_EXTENSION, false, (FixedSizeWriteableFactory<V>)index.getIndexStructure(structureName + "-factory") ); }
@SuppressWarnings("unchecked") public FSArrayFileInMem(IndexOnDisk index, String structureName) throws IOException { this( index.getPath() + "/" + index.getPrefix() + "." + structureName + FSArrayFile.USUAL_EXTENSION, false, (FixedSizeWriteableFactory<V>)index.getIndexStructure(structureName + "-factory") ); }
@SuppressWarnings("unchecked") protected FSADocumentIndex(IndexOnDisk index, String structureName, boolean initialise) throws IOException { super( index.getPath() + "/" + index.getPrefix() + "."+ structureName + FSArrayFile.USUAL_EXTENSION, false, (FixedSizeWriteableFactory<DocumentIndexEntry>) index.getIndexStructure(structureName+"-factory") ); if (initialise) initialise(index, structureName); }
/** return the lexicon outputstream for the current index at the specified filename */ @SuppressWarnings("unchecked") protected LexiconOutputStream<String> getLexOutputStream(String structureName) throws IOException { return new FSOMapFileLexiconOutputStream( index.getPath(), index.getPrefix(), structureName, (FixedSizeWriteableFactory<Text>)index.getIndexStructure(defaultStructureName+"-keyfactory")); }
@SuppressWarnings("unchecked") protected FSADocumentIndex(IndexOnDisk index, String structureName, boolean initialise) throws IOException { super( index.getPath() + "/" + index.getPrefix() + "."+ structureName + FSArrayFile.USUAL_EXTENSION, false, (FixedSizeWriteableFactory<DocumentIndexEntry>) index.getIndexStructure(structureName+"-factory") ); if (initialise) initialise(index, structureName); }
/** return the lexicon outputstream for the specified index at the specified filename */ @SuppressWarnings("unchecked") private static LexiconOutputStream<String> getLexOutputStream(IndexOnDisk index, String structureName) throws IOException { return new FSOMapFileLexiconOutputStream( index.getPath(), index.getPrefix(), structureName, (FixedSizeWriteableFactory<Text>)index.getIndexStructure(structureName+"-keyfactory")); }
@SuppressWarnings("unchecked") public FSADocumentIndexInMem(IndexOnDisk index, String structureName) throws IOException { super( index.getPath() + "/" + index.getPrefix() + "."+ structureName + FSArrayFile.USUAL_EXTENSION, false, (FixedSizeWriteableFactory<DocumentIndexEntry>) index.getIndexStructure(structureName+"-factory") ); docLengths = new int[this.size()]; for(int i=0;i<this.size();i++) { docLengths[i] = this.get(i).getDocumentLength(); } }
@SuppressWarnings("unchecked") public FSADocumentIndexInMem(IndexOnDisk index, String structureName) throws IOException { super( index.getPath() + "/" + index.getPrefix() + "."+ structureName + FSArrayFile.USUAL_EXTENSION, false, (FixedSizeWriteableFactory<DocumentIndexEntry>) index.getIndexStructure(structureName+"-factory") ); docLengths = new int[this.size()]; for(int i=0;i<this.size();i++) { docLengths[i] = this.get(i).getDocumentLength(); } }