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 int
addRef(int fileNum)
Adds a reference and records the change in footprint.void
addRefs(int[] refs)
Adds a set of references and records the change in footprint.int
compareTo(WordEntry other)
int
footprint()
Returns the size of the wordEntryint
getNumRefs()
Returns the number of references, e.g.int
getRef(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.void
mapRefs(int[] mappings)
Changes the references of the wordEntry to match the mapping.void
reset(char[] word)
Clears the wordEntry.String
toString()
-
-
-
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:
compareTo
in interfaceComparable<WordEntry>
-
-