com.b3dgs.lionengine.utility
Class Instructions

java.lang.Object
  extended by com.b3dgs.lionengine.utility.Instructions

public final class Instructions
extends java.lang.Object

Instructions manipulation, extracted from a file, to read typed informations.


Field Summary
static java.lang.String EMPTY
          Empty instruction.
static java.lang.String FALSE
          Boolean representation of False.
static java.lang.String NONE
          No instruction.
static java.lang.String TRUE
          Boolean representation of True.
 
Method Summary
static boolean decodeBoolean(java.lang.String line, char markerLeft, char markerRight)
          Extract a boolean from marker.
static float decodeFloat(java.lang.String line, char markerLeft, char markerRight)
          Extract a float from marker.
static int decodeInt(java.lang.String line, char markerLeft, char markerRight)
          Extract an integer from marker.
static java.lang.String decodeString(java.lang.String line, char markerLeft, char markerRight)
          Extract a string from marker.
static java.lang.String getSubsequenceFromCharInterval(java.lang.String line, char a, char b)
          Extract a part of a string contained between two chars.
static int searchChar(java.lang.String string, char c, int start)
          Search char position in a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static final java.lang.String EMPTY
Empty instruction.


TRUE

public static final java.lang.String TRUE
Boolean representation of True.


FALSE

public static final java.lang.String FALSE
Boolean representation of False.


NONE

public static final java.lang.String NONE
No instruction.

Method Detail

decodeString

public static java.lang.String decodeString(java.lang.String line,
                                            char markerLeft,
                                            char markerRight)
Extract a string from marker.

Parameters:
line - current line read by the decoder.
markerLeft - start marker.
markerRight - end marker.
Returns:
decoded string.

decodeBoolean

public static boolean decodeBoolean(java.lang.String line,
                                    char markerLeft,
                                    char markerRight)
Extract a boolean from marker.

Parameters:
line - current line read by the decoder.
markerLeft - start marker.
markerRight - end marker.
Returns:
decoded string.

decodeInt

public static int decodeInt(java.lang.String line,
                            char markerLeft,
                            char markerRight)
Extract an integer from marker.

Parameters:
line - current line read by the decoder.
markerLeft - start marker.
markerRight - end marker.
Returns:
decoded string.

decodeFloat

public static float decodeFloat(java.lang.String line,
                                char markerLeft,
                                char markerRight)
Extract a float from marker.

Parameters:
line - current line read by the decoder.
markerLeft - start marker.
markerRight - end marker.
Returns:
decoded string.

searchChar

public static int searchChar(java.lang.String string,
                             char c,
                             int start)
Search char position in a string.

Parameters:
string - string to check.
c - char to find.
start - start position.
Returns:
char index in string.

getSubsequenceFromCharInterval

public static java.lang.String getSubsequenceFromCharInterval(java.lang.String line,
                                                              char a,
                                                              char b)
Extract a part of a string contained between two chars.

Parameters:
line - string to check.
a - first char.
b - last char.
Returns:
extracted string.