com.web_visage.ichat
Class FailSafeParameterAccessor

java.lang.Object
  extended by com.web_visage.ichat.FailSafeParameterAccessor
All Implemented Interfaces:
IChatParameterAccessor

public class FailSafeParameterAccessor
extends java.lang.Object
implements IChatParameterAccessor

Accessor implementation for a fail-safe parameter reading.

Allows the client to read any parameter without raising any exception. In case when a parameter isn't accessable or malformed, returns it's most probabale or default value.

Author:
K.Baturytski

Constructor Summary
FailSafeParameterAccessor(java.lang.String[] aRawParameters)
          Constructor.
 
Method Summary
 int readInt(int anIdx)
          Returns an int paramter by the given index.
 EnumStatus readStatus(int anIdx)
          Returns a status parameter by the given index.
 java.lang.String readString(int anIdx)
          Returns a string parameter by the given index.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FailSafeParameterAccessor

public FailSafeParameterAccessor(java.lang.String[] aRawParameters)
Constructor.

Parameters:
aRawParameters -
Method Detail

readString

public java.lang.String readString(int anIdx)
Description copied from interface: IChatParameterAccessor
Returns a string parameter by the given index.

Specified by:
readString in interface IChatParameterAccessor
Parameters:
anIdx - - parameter's index
Returns:
See Also:
IChatParameterAccessor.readString(int)

readStatus

public EnumStatus readStatus(int anIdx)
Description copied from interface: IChatParameterAccessor
Returns a status parameter by the given index.

Specified by:
readStatus in interface IChatParameterAccessor
Parameters:
anIdx - - parameter's index
Returns:
See Also:
IChatParameterAccessor.readStatus(int)

readInt

public int readInt(int anIdx)
Description copied from interface: IChatParameterAccessor
Returns an int paramter by the given index.

Specified by:
readInt in interface IChatParameterAccessor
Parameters:
anIdx - - parameter's index
Returns:
See Also:
IChatParameterAccessor.readInt(int)