|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--mark.nlp.data.FileCategorySet
A FileCategorySet defines a set of categories to which files belong. The idea is that we are going to be working with a number of files. Each file belongs to exactly one category. Each Categoru has a name and a corresponding number in the range 0 through the number of categories minus one. A FileCategorySet knows the name<->number maps and how to determine a file's category. The class follows the Immutable design pattern.
| Constructor Summary | |
FileCategorySet(java.lang.String[] categoryNames)
Initializes the category set. |
|
| Method Summary | |
static FileCategorySet |
extract(ArgHelper args)
Extracts a file category set from an argument helper. |
java.lang.String |
map(int i)
Maps the integer representation of a category to its textual representation. |
int |
map(java.lang.String s)
Maps the string representation of a category it its integer representation. |
int |
mapFile(java.io.File f)
Returns the integer representation of the given file's category. |
int |
size()
Returns the number of categories. |
java.lang.String |
toString()
|
static java.lang.String |
usage()
Returns a usage string for specification of a file category set at the the command line. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public FileCategorySet(java.lang.String[] categoryNames)
categoryNames - a set of Strings defining the category names.| Method Detail |
public int size()
public java.lang.String toString()
toString in class java.lang.Object
public java.lang.String map(int i)
throws java.lang.Exception
i - the integer representation [0, numCategories ()).
java.lang.Exception
public int map(java.lang.String s)
throws java.lang.Exception
s - the string representation.
java.lang.Exception
public int mapFile(java.io.File f)
throws java.lang.Exception
f - the file.
java.lang.Exception - if the mapping does not exist.public static java.lang.String usage()
public static FileCategorySet extract(ArgHelper args)
throws java.lang.Exception
args - the argument helper.
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||