de.mud.telnet
Class ScriptHandler

java.lang.Object
  extended by de.mud.telnet.ScriptHandler

public class ScriptHandler
extends java.lang.Object

A script handler, that tries to match strings and returns true when it found the string it searched for.

Maintainer: Matthias L. Jugel

Version:
$Id: ScriptHandler.java 499 2005-09-29 08:24:54Z leo $
Author:
Matthias L. Jugel, Marcus Mei???ner

Constructor Summary
ScriptHandler()
           
 
Method Summary
 boolean match(byte[] s, int length)
          Try to match the byte array s against the match string.
 void setup(java.lang.String match)
          Setup the parser using the passed string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptHandler

public ScriptHandler()
Method Detail

setup

public void setup(java.lang.String match)
Setup the parser using the passed string.

Parameters:
match - the string to look for

match

public boolean match(byte[] s,
                     int length)
Try to match the byte array s against the match string.

Parameters:
s - the array of bytes to match against
length - the amount of bytes in the array
Returns:
true if the string was found, else false