net.jetrix.protocols
Class TspecProtocol

java.lang.Object
  extended by net.jetrix.protocols.TetrinetProtocol
      extended by net.jetrix.protocols.TspecProtocol
All Implemented Interfaces:
Protocol

public class TspecProtocol
extends TetrinetProtocol

An abstract protocol to communicate with a client.

Version:
$Revision: 426 $, $Date: 2004-10-03 19:32:15 +0200 (dim., 03 oct. 2004) $
Author:
Emmanuel Bourg

Constructor Summary
TspecProtocol()
           
 
Method Summary
 Message getMessage(String line)
          Parse the specified string and return the corresponding server message for this protocol.
 String getName()
          Return the name of this protocol
 String toString()
           
 String translate(JoinMessage m, Locale locale)
           
 String translate(LeaveMessage m, Locale locale)
           
 String translate(Message m, Locale locale)
          Translate the specified message into a string that will be sent to a client using this protocol.
 String translate(SmsgMessage m, Locale locale)
           
 String translate(SpectatorListMessage m, Locale locale)
           
 
Methods inherited from class net.jetrix.protocols.TetrinetProtocol
applyStyle, decode, encode, getEOL, getStyles, readLine, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TspecProtocol

public TspecProtocol()
Method Detail

getName

public String getName()
Return the name of this protocol

Specified by:
getName in interface Protocol
Overrides:
getName in class TetrinetProtocol
Returns:
the name of this protocol

getMessage

public Message getMessage(String line)
Parse the specified string and return the corresponding server message for this protocol.

Specified by:
getMessage in interface Protocol
Overrides:
getMessage in class TetrinetProtocol
Parameters:
line - the client message to parse
Returns:
the Message equivalent of the specified String or null if the protocol cannot understand the message.

translate

public String translate(Message m,
                        Locale locale)
Translate the specified message into a string that will be sent to a client using this protocol.

Specified by:
translate in interface Protocol
Overrides:
translate in class TetrinetProtocol
Parameters:
m - the message to translate
locale - the locale used for internationalized text messages
Returns:
the String equivalent in this protocol for the specified Message or null if it can't be translated.

translate

public String translate(SpectatorListMessage m,
                        Locale locale)
Overrides:
translate in class TetrinetProtocol

translate

public String translate(SmsgMessage m,
                        Locale locale)
Overrides:
translate in class TetrinetProtocol

translate

public String translate(JoinMessage m,
                        Locale locale)
Overrides:
translate in class TetrinetProtocol

translate

public String translate(LeaveMessage m,
                        Locale locale)
Overrides:
translate in class TetrinetProtocol

toString

public String toString()
Overrides:
toString in class TetrinetProtocol


Copyright © 2001-2008 Emmanuel Bourg. All Rights Reserved.