net.sf.dict4j.command
Class MatchCommand

java.lang.Object
  extended by net.sf.dict4j.command.AbstractCommand
      extended by net.sf.dict4j.command.AbstractDataCommand
          extended by net.sf.dict4j.command.AbstractListDataCommand
              extended by net.sf.dict4j.command.MatchCommand
All Implemented Interfaces:
Command, DataCommand

public class MatchCommand
extends AbstractListDataCommand

MATCH database strategy word

This command searches an index for the dictionary, and reports words which were found using a particular strategy. Not all strategies are useful for all dictionaries, and some dictionaries may support additional search strategies (e.g., reverse lookup)


Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.dict4j.command.AbstractListDataCommand
AbstractListDataCommand.Entry
 
Field Summary
 
Fields inherited from class net.sf.dict4j.command.AbstractDataCommand
responseText
 
Fields inherited from class net.sf.dict4j.command.AbstractCommand
responseCode, responseStatus
 
Constructor Summary
MatchCommand(Database database, Strategy strategy, java.lang.String word)
           
MatchCommand(Database database, java.lang.String word)
           
MatchCommand(Strategy strategy, java.lang.String word)
           
MatchCommand(java.lang.String word)
           
MatchCommand(java.lang.String database, java.lang.String strategy, java.lang.String word)
           
 
Method Summary
protected  void checkResponseCodeForServerException(ResponseEnum responseEnum)
           
protected  boolean doesResponseHaveBody()
           
 java.util.List<DatabaseWord> getDatabaseWordList()
           
 int getNumberOfMatchesFound()
           
protected  ResponseEnum[] getResponseHeaderCodes()
          552 No match 152 n matches found - text follows
protected  java.lang.String getString()
           
protected  void parseResponseHeader(java.lang.String header)
           
protected  void parseResponseText()
           
 
Methods inherited from class net.sf.dict4j.command.AbstractListDataCommand
getList, receiveBody
 
Methods inherited from class net.sf.dict4j.command.AbstractDataCommand
getResponseFooterEnum, getResponseText, receiveFooter, send
 
Methods inherited from class net.sf.dict4j.command.AbstractCommand
getResponseCode, getResponseEnum, getResponseHeaderEnum, getResponseStatus, parseResponse, receiveHeader, stripQuotes, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.dict4j.command.Command
getResponseCode, getResponseStatus
 

Constructor Detail

MatchCommand

public MatchCommand(java.lang.String database,
                    java.lang.String strategy,
                    java.lang.String word)

MatchCommand

public MatchCommand(Database database,
                    Strategy strategy,
                    java.lang.String word)

MatchCommand

public MatchCommand(Strategy strategy,
                    java.lang.String word)

MatchCommand

public MatchCommand(Database database,
                    java.lang.String word)

MatchCommand

public MatchCommand(java.lang.String word)
Method Detail

parseResponseText

protected void parseResponseText()
Overrides:
parseResponseText in class AbstractListDataCommand

parseResponseHeader

protected void parseResponseHeader(java.lang.String header)
Overrides:
parseResponseHeader in class AbstractCommand

doesResponseHaveBody

protected boolean doesResponseHaveBody()
Overrides:
doesResponseHaveBody in class AbstractDataCommand

getResponseHeaderCodes

protected ResponseEnum[] getResponseHeaderCodes()
552 No match 152 n matches found - text follows

Specified by:
getResponseHeaderCodes in class AbstractCommand
Returns:
array of valid response codes

checkResponseCodeForServerException

protected void checkResponseCodeForServerException(ResponseEnum responseEnum)
                                            throws DictServerException
Overrides:
checkResponseCodeForServerException in class AbstractCommand
Throws:
DictServerException

getString

protected java.lang.String getString()
Specified by:
getString in class AbstractCommand

getDatabaseWordList

public java.util.List<DatabaseWord> getDatabaseWordList()

getNumberOfMatchesFound

public int getNumberOfMatchesFound()