public class WordEntry extends Object implements Comparable<WordEntry>
Modifier and Type | Field and Description |
---|---|
protected int |
fNumRefs |
protected int[] |
fRefs |
protected char[] |
fWord |
Modifier and Type | Method and 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 wordEntry
|
int |
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() |
protected char[] fWord
protected int fNumRefs
protected int[] fRefs
public int addRef(int fileNum)
public void addRefs(int[] refs)
public int footprint()
public int getNumRefs()
public int getRef(int i)
public int[] getRefs()
public char[] getWord()
public void mapRefs(int[] mappings)
public void reset(char[] word)
public int compareTo(WordEntry other)
compareTo
in interface Comparable<WordEntry>
Copyright © 2019. All rights reserved.