Package org.teiid.internal.core.index
Class WordEntry
- java.lang.Object
-
- org.teiid.internal.core.index.WordEntry
-
- All Implemented Interfaces:
Comparable<WordEntry>
public class WordEntry extends Object implements Comparable<WordEntry>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intaddRef(int fileNum)Adds a reference and records the change in footprint.voidaddRefs(int[] refs)Adds a set of references and records the change in footprint.intcompareTo(WordEntry other)intfootprint()Returns the size of the wordEntryintgetNumRefs()Returns the number of references, e.g.intgetRef(int i)returns the file number in the i position in the list of references.int[]getRefs()Returns the references of the wordEntry (the number of the files it appears in).char[]getWord()returns the word of the wordEntry.voidmapRefs(int[] mappings)Changes the references of the wordEntry to match the mapping.voidreset(char[] word)Clears the wordEntry.StringtoString()
-
-
-
Method Detail
-
addRef
public int addRef(int fileNum)
Adds a reference and records the change in footprint.
-
addRefs
public void addRefs(int[] refs)
Adds a set of references and records the change in footprint.
-
footprint
public int footprint()
Returns the size of the wordEntry
-
getNumRefs
public int getNumRefs()
Returns the number of references, e.g. the number of files this word appears in.
-
getRef
public int getRef(int i)
returns the file number in the i position in the list of references.
-
getRefs
public int[] getRefs()
Returns the references of the wordEntry (the number of the files it appears in).
-
getWord
public char[] getWord()
returns the word of the wordEntry.
-
mapRefs
public void mapRefs(int[] mappings)
Changes the references of the wordEntry to match the mapping. For example,
if the current references are [1 3 4]
and mapping is [1 2 3 4 5]
in references 1 becomes mapping[1] = 2, 3->4, and 4->5
=> references = [2 4 5].
-
reset
public void reset(char[] word)
Clears the wordEntry.
-
compareTo
public int compareTo(WordEntry other)
- Specified by:
compareToin interfaceComparable<WordEntry>
-
-