de.scheisseichfindemalkeinen.keywords
Class KeywordManager

java.lang.Object
  extended by de.scheisseichfindemalkeinen.keywords.KeywordManager

public class KeywordManager
extends java.lang.Object

Class which holds the Keywords


Field Summary
static int MATCH_ALL
          All keywords found
static int MATCH_ALL_STRICT
          All keywords found, but strict search
static int MATCH_ONLY_EXACT
          Only exact matches
static int MATCHED_ALL_KEYWORDS
          All keywords found
static int MATCHED_EXACT
          Exact match
static int MATCHED_NOT
          No match
static int MATCHED_SOME_KEYWORDS
          Some keywords found
static java.lang.String[] MATCHED_T
          Strings for kind of matches
 
Method Summary
 void addKeyword(Keyword k, boolean commitDatabase)
          Add a Keyword We can specifie if we want the method to commit the database.
 void addKeywords(java.util.Vector<Keyword> keywords)
          Add Keywords to the array
 java.util.Vector<Keyword> getKeywords()
          Returns an array containing the Keywords
static KeywordManager instance()
          Returns the instance
 void saveKeywords()
          Save Keywords to the database This method does commit the database
 void setKeywords(java.util.Vector<Keyword> keywords)
          Sets the Keywords Attention: This method replaces the whole array!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MATCHED_NOT

public static final int MATCHED_NOT
No match

See Also:
Constant Field Values

MATCHED_EXACT

public static final int MATCHED_EXACT
Exact match

See Also:
Constant Field Values

MATCHED_ALL_KEYWORDS

public static final int MATCHED_ALL_KEYWORDS
All keywords found

See Also:
Constant Field Values

MATCHED_SOME_KEYWORDS

public static final int MATCHED_SOME_KEYWORDS
Some keywords found

See Also:
Constant Field Values

MATCHED_T

public static final java.lang.String[] MATCHED_T
Strings for kind of matches


MATCH_ONLY_EXACT

public static final int MATCH_ONLY_EXACT
Only exact matches

See Also:
Constant Field Values

MATCH_ALL_STRICT

public static final int MATCH_ALL_STRICT
All keywords found, but strict search

See Also:
Constant Field Values

MATCH_ALL

public static final int MATCH_ALL
All keywords found

See Also:
Constant Field Values
Method Detail

instance

public static KeywordManager instance()
Returns the instance

Returns:
Instance

getKeywords

public java.util.Vector<Keyword> getKeywords()
Returns an array containing the Keywords

Returns:
Keywords-Array

setKeywords

public void setKeywords(java.util.Vector<Keyword> keywords)
Sets the Keywords Attention: This method replaces the whole array!

Parameters:
keywords - Vector mit Keywords

addKeywords

public void addKeywords(java.util.Vector<Keyword> keywords)
Add Keywords to the array

Parameters:
keywords - Keywords

addKeyword

public void addKeyword(Keyword k,
                       boolean commitDatabase)
Add a Keyword We can specifie if we want the method to commit the database. Maybe we don't want to do this for a single Keyword, because it took some time to commit. But it is better to use the addKeywords-Method to add multiple Keywords. When we can't do this, then use this method with set commitDatabase to false and use then the saveKeywords-Method or commit the databse by DB.commit(DB.DB_KEYWORDS)

Parameters:
k - Keyword
commitDatabase - Commit Database

saveKeywords

public void saveKeywords()
Save Keywords to the database This method does commit the database