gnutant
Class Keywords

java.lang.Object
  |
  +--gnutant.Keywords

public class Keywords
extends java.lang.Object

Provides a holder for keywords, read from an ASCII file with a set of keywords on each line.

Version:
$Revision$
Author:
Hein Meling

Constructor Summary
Keywords(java.lang.String kwFile)
          Loads the specified keyword file, entirely.
Keywords(java.lang.String kwFile, int lines)
          Loads the specified keyword file, limited by the number of keyword lines to load into the keyword list.
 
Method Summary
 java.lang.String getKeyword(int index)
          Returns the keyword stored in the given position.
 java.lang.String getRndKeyword()
          Returns a random keyword from the keywordList.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Keywords

public Keywords(java.lang.String kwFile)
         throws java.io.FileNotFoundException
Loads the specified keyword file, entirely.
Parameters:
kwFile - the filename of the keyword file.

Keywords

public Keywords(java.lang.String kwFile,
                int lines)
         throws java.io.FileNotFoundException
Loads the specified keyword file, limited by the number of keyword lines to load into the keyword list.
Parameters:
kwFile - the filename of the keyword file.
lines - the number of lines to load; used to limit the number of keyword lines to load into the keywordList.
Method Detail

getKeyword

public java.lang.String getKeyword(int index)
Returns the keyword stored in the given position.

Note that this method may return a null object if the index position is beyond that held within the keywordList.

Parameters:
index - position into the keywordList.
Returns:
a String containing a set of keywords associated with the given index position in the keywordList.

getRndKeyword

public java.lang.String getRndKeyword()
Returns a random keyword from the keywordList.
Returns:
a String containing a set of keywords.