Atavism Version 2018.1AGIS API

atavism.msgsys
Class MessageCatalog

java.lang.Object
  extended by atavism.msgsys.MessageCatalog

public class MessageCatalog
extends java.lang.Object

A mapping from message type string to integer message number.


Constructor Summary
MessageCatalog(java.lang.String name, int firstMsgNumber, int msgNumberCount)
          Create message catalog instance.
 
Method Summary
static MessageCatalog addMsgCatalog(MessageCatalog catalog)
          Add a catalog instance to the catalog set.
static MessageCatalog addMsgCatalog(java.lang.String name, int firstMsgNumber, int msgNumberCount)
          Create a catalog with the given name and message number range, and add to the catalog set.
 void addMsgTypeTranslation(MessageType msgType)
          Add a translation for the given msgTypeString, using the next available message number.
 void addMsgTypeTranslation(MessageType msgType, int msgNumber)
          A seldom-used overloading that adds a translation for the given msgTypeString, using a specific message number.
 void addMsgTypeTranslation(java.lang.String msgTypeString)
          Add a translation for the given msgTypeString, using the next available message number.
 int getFirstMsgNumber()
          Get the first number in the message range.
 int getLastMsgNumber()
          Get the last number in the message range.
static java.lang.Integer getMessageNumber(java.lang.String msgTypeString)
          Look up a message string in the list of catalogs.
static MessageType getMessageType(java.lang.Integer msgTypeNumber)
          Get MessageType by message number.
static MessageType getMessageType(java.lang.String msgTypeString)
          Get MessageType by string.
 java.lang.Integer getMsgNumberFromString(java.lang.String msgTypeString)
          Get message number by string.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MessageCatalog

public MessageCatalog(java.lang.String name,
                      int firstMsgNumber,
                      int msgNumberCount)
Create message catalog instance. Applications should use addMsgCatalog(String,int,int).

Method Detail

getMessageNumber

public static java.lang.Integer getMessageNumber(java.lang.String msgTypeString)
Look up a message string in the list of catalogs. A given string is not supposed to be defined in more than one catalog.

Returns:
Message number, or null if not found.

getMessageType

public static MessageType getMessageType(java.lang.Integer msgTypeNumber)
Get MessageType by message number.


getMessageType

public static MessageType getMessageType(java.lang.String msgTypeString)
Get MessageType by string.


addMsgCatalog

public static MessageCatalog addMsgCatalog(java.lang.String name,
                                           int firstMsgNumber,
                                           int msgNumberCount)
Create a catalog with the given name and message number range, and add to the catalog set.


addMsgCatalog

public static MessageCatalog addMsgCatalog(MessageCatalog catalog)
Add a catalog instance to the catalog set.


getMsgNumberFromString

public java.lang.Integer getMsgNumberFromString(java.lang.String msgTypeString)
Get message number by string. Applications should use getMessageNumber(java.lang.String).


addMsgTypeTranslation

public void addMsgTypeTranslation(java.lang.String msgTypeString)
Add a translation for the given msgTypeString, using the next available message number.


addMsgTypeTranslation

public void addMsgTypeTranslation(MessageType msgType)
Add a translation for the given msgTypeString, using the next available message number.


addMsgTypeTranslation

public void addMsgTypeTranslation(MessageType msgType,
                                  int msgNumber)
A seldom-used overloading that adds a translation for the given msgTypeString, using a specific message number.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getFirstMsgNumber

public int getFirstMsgNumber()
Get the first number in the message range.


getLastMsgNumber

public int getLastMsgNumber()
Get the last number in the message range.



Copyright © 2018 Dragonsan Studios Sp. z o.o.