org.maachang.engine.util
クラス ConvertParam

java.lang.Object
  上位を拡張 org.maachang.engine.util.ConvertParam

public class ConvertParam
extends java.lang.Object

プリミティブ型の情報を、バイナリ情報にコンバートする為の処理群.

プリミティブ型の情報を、バイナリ情報にコンバートする為の処理群です.

導入されたバージョン:
MaaEngine 1.00
バージョン:
2007/10/18
作成者:
masahito suzuki

フィールドの概要
static java.lang.String CHARSET
          対象キャラクタセット.
static int LENGTH_BOOLEAN
          データ長 : boolean.
static int LENGTH_BYTE
          データ長 : byte.
static int LENGTH_CHAR
          データ長 : char.
static int LENGTH_INT
          データ長 : int.
static int LENGTH_LONG
          データ長 : long.
static int LENGTH_SHORT
          データ長 : short.
 
メソッドの概要
static byte[] convertBoolean(boolean value)
          コンバート処理.
static void convertBoolean(byte[] out, int offset, boolean value)
          コンバート処理.
static boolean convertBoolean(int off, byte[] binary)
          コンバート処理.
static byte[] convertByte(byte value)
          コンバート処理.
static void convertByte(byte[] out, int offset, byte value)
          コンバート処理.
static byte convertByte(int off, byte[] binary)
          コンバート処理.
static void convertChar(byte[] out, int offset, char value)
          コンバート処理.
static byte[] convertChar(char value)
          コンバート処理.
static char convertChar(int off, byte[] binary)
          コンバート処理.
static void convertChars(byte[] out, int offset, char[] value)
          コンバート処理.
static byte[] convertChars(char[] value)
          コンバート処理.
static char[] convertChars(int off, int length, byte[] binary)
          コンバート処理.
static byte[] convertDecimal(java.math.BigDecimal value)
          コンバート処理.
static int convertDecimal(byte[] out, int offset, java.math.BigDecimal value)
          コンバート処理.
static java.math.BigDecimal convertDecimal(int off, byte[] binary)
          コンバート処理.
static int convertDouble(byte[] out, int offset, double value)
          コンバート処理.
static byte[] convertDouble(double value)
          コンバート処理.
static double convertDouble(int off, byte[] binary)
          コンバート処理.
static int convertFloat(byte[] out, int offset, float value)
          コンバート処理.
static byte[] convertFloat(float value)
          コンバート処理.
static float convertFloat(int off, byte[] binary)
          コンバート処理.
static java.lang.String convertFloatBinaryByString(int off, byte[] binary)
          小数点バイナリ情報を文字列に変換.
static void convertInt(byte[] out, int offset, int value)
          コンバート処理.
static byte[] convertInt(int value)
          コンバート処理.
static int convertInt(int off, byte[] binary)
          コンバート処理.
static void convertLong(byte[] out, int offset, long value)
          コンバート処理.
static long convertLong(int off, byte[] binary)
          コンバート処理.
static byte[] convertLong(long value)
          コンバート処理.
static void convertShort(byte[] out, int offset, short value)
          コンバート処理.
static short convertShort(int off, byte[] binary)
          コンバート処理.
static byte[] convertShort(short value)
          コンバート処理.
static int convertString(byte[] out, int offset, java.lang.String value)
          コンバート処理.
static java.lang.String convertString(int off, int length, byte[] binary)
          コンバート処理.
static byte[] convertString(java.lang.String value)
          コンバート処理.
static char swap(char value)
          2バイト情報を反転.
static int swap(int value)
          4バイト情報を反転.
static long swap(long value)
          8バイト情報を反転.
static short swap(short value)
          2バイト情報を反転.
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

CHARSET

public static final java.lang.String CHARSET
対象キャラクタセット.

関連項目:
定数フィールド値

LENGTH_BOOLEAN

public static final int LENGTH_BOOLEAN
データ長 : boolean.

関連項目:
定数フィールド値

LENGTH_BYTE

public static final int LENGTH_BYTE
データ長 : byte.

関連項目:
定数フィールド値

LENGTH_CHAR

public static final int LENGTH_CHAR
データ長 : char.

関連項目:
定数フィールド値

LENGTH_SHORT

public static final int LENGTH_SHORT
データ長 : short.

関連項目:
定数フィールド値

LENGTH_INT

public static final int LENGTH_INT
データ長 : int.

関連項目:
定数フィールド値

LENGTH_LONG

public static final int LENGTH_LONG
データ長 : long.

関連項目:
定数フィールド値
メソッドの詳細

swap

public static final short swap(short value)
2バイト情報を反転.

2バイト(short)情報を反転します.

パラメータ:
value - 反転対象の情報を設定します.
戻り値:
short 反転された情報が返されます.

swap

public static final char swap(char value)
2バイト情報を反転.

2バイト(char)情報を反転します.

パラメータ:
value - 反転対象の情報を設定します.
戻り値:
char 反転された情報が返されます.

swap

public static final int swap(int value)
4バイト情報を反転.

4バイト(int)情報を反転します.

パラメータ:
value - 反転対象の情報を設定します.
戻り値:
int 反転された情報が返されます.

swap

public static final long swap(long value)
8バイト情報を反転.

8バイト(long)情報を反転します.

パラメータ:
value - 反転対象の情報を設定します.
戻り値:
long 反転された情報が返されます.

convertBoolean

public static final byte[] convertBoolean(boolean value)
コンバート処理.

boolean情報をバイナリ変換します.

パラメータ:
value - 変換対象の処理を設定します.
戻り値:
byte[] 変換されたバイナリ情報が返されます.

convertBoolean

public static final void convertBoolean(byte[] out,
                                        int offset,
                                        boolean value)
コンバート処理.

boolean情報をバイナリ変換します.

パラメータ:
out - 設定対象のバイナリ情報を設定します.
offset - 設定対象のオフセット位置を設定します.
value - 変換対象の処理を設定します.

convertBoolean

public static final boolean convertBoolean(int off,
                                           byte[] binary)
                                    throws java.lang.Exception
コンバート処理.

対象のバイナリ情報をboolean変換します.

パラメータ:
off - 変換対象バイナリのオフセット値を設定します.
binary - 変換対象のバイナリ情報を設定します.
戻り値:
boolean 変換された情報が返されます.
例外:
java.lang.Exception - 入力例外.

convertByte

public static final byte[] convertByte(byte value)
コンバート処理.

byte情報をバイナリ変換します.

パラメータ:
value - 変換対象の処理を設定します.
戻り値:
byte[] 変換されたバイナリ情報が返されます.

convertByte

public static final void convertByte(byte[] out,
                                     int offset,
                                     byte value)
コンバート処理.

byte情報をバイナリ変換します.

パラメータ:
out - 設定対象のバイナリ情報を設定します.
offset - 設定対象のオフセット位置を設定します.
value - 変換対象の処理を設定します.

convertByte

public static final byte convertByte(int off,
                                     byte[] binary)
                              throws java.lang.Exception
コンバート処理.

対象のバイナリ情報をbyte変換します.

パラメータ:
off - 変換対象バイナリのオフセット値を設定します.
binary - 変換対象のバイナリ情報を設定します.
戻り値:
byte 変換された情報が返されます.
例外:
java.lang.Exception - 入力例外.

convertChar

public static final byte[] convertChar(char value)
コンバート処理.

char情報をバイナリ変換します.

パラメータ:
value - 変換対象の処理を設定します.
戻り値:
byte[] 変換されたバイナリ情報が返されます.

convertChar

public static final void convertChar(byte[] out,
                                     int offset,
                                     char value)
コンバート処理.

char情報をバイナリ変換します.

パラメータ:
out - 設定対象のバイナリ情報を設定します.
offset - 設定対象のオフセット位置を設定します.
value - 変換対象の処理を設定します.

convertChar

public static final char convertChar(int off,
                                     byte[] binary)
                              throws java.lang.Exception
コンバート処理.

対象のバイナリ情報をchar変換します.

パラメータ:
off - 変換対象バイナリのオフセット値を設定します.
binary - 変換対象のバイナリ情報を設定します.
戻り値:
char 変換された情報が返されます.
例外:
java.lang.Exception - 入力例外.

convertShort

public static final byte[] convertShort(short value)
コンバート処理.

short情報をバイナリ変換します.

パラメータ:
value - 変換対象の処理を設定します.
戻り値:
byte[] 変換されたバイナリ情報が返されます.

convertShort

public static final void convertShort(byte[] out,
                                      int offset,
                                      short value)
コンバート処理.

short情報をバイナリ変換します.

パラメータ:
out - 設定対象のバイナリ情報を設定します.
offset - 設定対象のオフセット位置を設定します.
value - 変換対象の処理を設定します.

convertShort

public static final short convertShort(int off,
                                       byte[] binary)
                                throws java.lang.Exception
コンバート処理.

対象のバイナリ情報をshort変換します.

パラメータ:
off - 変換対象バイナリのオフセット値を設定します.
binary - 変換対象のバイナリ情報を設定します.
戻り値:
short 変換された情報が返されます.
例外:
java.lang.Exception - 入力例外.

convertInt

public static final byte[] convertInt(int value)
コンバート処理.

int情報をバイナリ変換します.

パラメータ:
value - 変換対象の処理を設定します.
戻り値:
byte[] 変換されたバイナリ情報が返されます.

convertInt

public static final void convertInt(byte[] out,
                                    int offset,
                                    int value)
コンバート処理.

int情報をバイナリ変換します.

パラメータ:
out - 設定対象のバイナリ情報を設定します.
offset - 設定対象のオフセット位置を設定します.
value - 変換対象の処理を設定します.

convertInt

public static final int convertInt(int off,
                                   byte[] binary)
                            throws java.lang.Exception
コンバート処理.

対象のバイナリ情報をint変換します.

パラメータ:
off - 変換対象バイナリのオフセット値を設定します.
binary - 変換対象のバイナリ情報を設定します.
戻り値:
int 変換された情報が返されます.
例外:
java.lang.Exception - 入力例外.

convertLong

public static final byte[] convertLong(long value)
コンバート処理.

long情報をバイナリ変換します.

パラメータ:
value - 変換対象の処理を設定します.
戻り値:
byte[] 変換されたバイナリ情報が返されます.

convertLong

public static final void convertLong(byte[] out,
                                     int offset,
                                     long value)
コンバート処理.

long情報をバイナリ変換します.

パラメータ:
out - 設定対象のバイナリ情報を設定します.
offset - 設定対象のオフセット位置を設定します.
value - 変換対象の処理を設定します.

convertLong

public static final long convertLong(int off,
                                     byte[] binary)
                              throws java.lang.Exception
コンバート処理.

対象のバイナリ情報をlong変換します.

パラメータ:
off - 変換対象バイナリのオフセット値を設定します.
binary - 変換対象のバイナリ情報を設定します.
戻り値:
long 変換された情報が返されます.
例外:
java.lang.Exception - 入力例外.

convertFloat

public static final byte[] convertFloat(float value)
コンバート処理.

float情報をバイナリ変換します.

パラメータ:
value - 変換対象の処理を設定します.
戻り値:
byte[] 変換されたバイナリ情報が返されます.

convertFloat

public static final int convertFloat(byte[] out,
                                     int offset,
                                     float value)
コンバート処理.

float情報をバイナリ変換します.

パラメータ:
out - 設定対象のバイナリ情報を設定します.
offset - 設定対象のオフセット位置を設定します.
value - 変換対象の処理を設定します.
戻り値:
int 変換された情報長が返されます.

convertFloat

public static final float convertFloat(int off,
                                       byte[] binary)
                                throws java.lang.Exception
コンバート処理.

対象のバイナリ情報をfloat変換します.

パラメータ:
off - 変換対象バイナリのオフセット値を設定します.
binary - 変換対象のバイナリ情報を設定します.
戻り値:
float 変換された情報が返されます.
例外:
java.lang.Exception - 入力例外.

convertDouble

public static final byte[] convertDouble(double value)
コンバート処理.

double情報をバイナリ変換します.

パラメータ:
value - 変換対象の処理を設定します.
戻り値:
byte[] 変換されたバイナリ情報が返されます.

convertDouble

public static final int convertDouble(byte[] out,
                                      int offset,
                                      double value)
コンバート処理.

double情報をバイナリ変換します.

パラメータ:
out - 設定対象のバイナリ情報を設定します.
offset - 設定対象のオフセット位置を設定します.
value - 変換対象の処理を設定します.
戻り値:
int 変換された情報長が返されます.

convertDouble

public static final double convertDouble(int off,
                                         byte[] binary)
                                  throws java.lang.Exception
コンバート処理.

対象のバイナリ情報をdouble変換します.

パラメータ:
off - 変換対象バイナリのオフセット値を設定します.
binary - 変換対象のバイナリ情報を設定します.
戻り値:
double 変換された情報が返されます.
例外:
java.lang.Exception - 入力例外.

convertDecimal

public static final byte[] convertDecimal(java.math.BigDecimal value)
コンバート処理.

Decimal情報をバイナリ変換します.

パラメータ:
value - 変換対象の処理を設定します.
戻り値:
byte[] 変換されたバイナリ情報が返されます.

convertDecimal

public static final int convertDecimal(byte[] out,
                                       int offset,
                                       java.math.BigDecimal value)
コンバート処理.

Decimal情報をバイナリ変換します.

パラメータ:
out - 設定対象のバイナリ情報を設定します.
offset - 設定対象のオフセット位置を設定します.
value - 変換対象の処理を設定します.
戻り値:
int 変換された情報長が返されます.

convertDecimal

public static final java.math.BigDecimal convertDecimal(int off,
                                                        byte[] binary)
                                                 throws java.lang.Exception
コンバート処理.

対象のバイナリ情報をBigDecimal変換します.

パラメータ:
off - 変換対象バイナリのオフセット値を設定します.
binary - 変換対象のバイナリ情報を設定します.
戻り値:
BigDecimal 変換された情報が返されます.
例外:
java.lang.Exception - 入力例外.

convertChars

public static final byte[] convertChars(char[] value)
コンバート処理.

char配列情報をバイナリ変換します.

パラメータ:
value - 変換対象の処理を設定します.
戻り値:
byte[] 変換されたバイナリ情報が返されます.

convertChars

public static final void convertChars(byte[] out,
                                      int offset,
                                      char[] value)
コンバート処理.

char配列情報をバイナリ変換します.

パラメータ:
out - 設定対象のバイナリ情報を設定します.
offset - 設定対象のオフセット位置を設定します.
value - 変換対象の処理を設定します.

convertChars

public static final char[] convertChars(int off,
                                        int length,
                                        byte[] binary)
                                 throws java.lang.Exception
コンバート処理.

対象のバイナリ情報をchar配列変換します.

パラメータ:
off - 変換対象バイナリのオフセット値を設定します.
length - 変換対象バイナリの変換データ長を設定します.
binary - 変換対象のバイナリ情報を設定します.
戻り値:
char[] 変換された情報が返されます.
例外:
java.lang.Exception - 入力例外.

convertString

public static final byte[] convertString(java.lang.String value)
                                  throws java.lang.Exception
コンバート処理.

String情報をバイナリ変換します.

パラメータ:
value - 変換対象の処理を設定します.
戻り値:
byte[] 変換されたバイナリ情報が返されます.
例外:
java.lang.Exception - 例外.

convertString

public static final int convertString(byte[] out,
                                      int offset,
                                      java.lang.String value)
                               throws java.lang.Exception
コンバート処理.

String情報をバイナリ変換します.

パラメータ:
out - 設定対象のバイナリ情報を設定します.
offset - 設定対象のオフセット位置を設定します.
value - 変換対象の処理を設定します.
戻り値:
int 変換されたバイナリ長が返されます.
例外:
java.lang.Exception - 例外.

convertString

public static final java.lang.String convertString(int off,
                                                   int length,
                                                   byte[] binary)
                                            throws java.lang.Exception
コンバート処理.

対象のバイナリ情報をString変換します.

パラメータ:
off - 変換対象バイナリのオフセット値を設定します.
length - 変換対象バイナリの変換データ長を設定します.
binary - 変換対象のバイナリ情報を設定します.
戻り値:
String 変換された情報が返されます.
例外:
java.lang.Exception - 入力例外.

convertFloatBinaryByString

public static final java.lang.String convertFloatBinaryByString(int off,
                                                                byte[] binary)
                                                         throws java.lang.Exception
小数点バイナリ情報を文字列に変換.

例外:
java.lang.Exception