jp.gr.java_conf.dangan.lang.reflect
Class Type
Reflection の機能を扱いやすくするように
型情報を扱うユーティリティクラス。
-- revision history --
$Log: Type.java,v $
Revision 1.0 2002/10/01 00:00:00 dangan
first edition
add to version control
static boolean | match(Class type, Object obj) - obj が type の実体であるかを得る。
obj が Type.parse( type, obj ) で変換可能な場合
trueを返す。
|
static boolean | matchAll(Class[] types, Object[] args) - args が Type.parse による変換を伴えば
types と一致するかを得る。
|
static boolean | matchFull(Class type, Object obj) - obj が変換無しで type と一致するかを得る。
|
static boolean | matchFullAll(Class[] types, Object[] args) - args が変換無しで types と一致するかを得る。
|
static boolean | matchRestrict(Class type, Object obj) - obj が type の実体であるかを得る。
type が数値を示すプリミティブ型
( byte, short, int, long, float, double のいずれか )を
であり、かつ obj がそれらのプリミティブのラッパ型、
( Byte, Short, Integer, Long, Float, Double のいずれか )
のインスタンスである場合 変換可能と判断して true を返す。
|
static boolean | matchRestrictAll(Class[] types, Object[] args) - args が Type.parse による変換を伴えば
types と一致するかを得る。
matchAll() より厳§に判定する。
|
static Object | parse(Class type, Object obj) - Factory.match( type, obj ) でマッチした obj を
type で示される型に変換する。
|
static Object[] | parseAll(Class[] types, Object[] args) - Factory.matchAll( types, args ) でマッチした args を
一括して types で示される型に変換する。
|
match
public static boolean match(Class type,
Object obj)
obj が type の実体であるかを得る。
obj が Type.parse( type, obj ) で変換可能な場合
trueを返す。
type
- 型情報obj
- 判定対象のオブジェクト
- obj が type の実体であれば true。
違えば false。
matchAll
public static boolean matchAll(Class[] types,
Object[] args)
args が Type.parse による変換を伴えば
types と一致するかを得る。
types
- 型情報配列args
- 判定対象のオブジェクト配列
- args が types に一致すれば true。
違えば flase。
matchFull
public static boolean matchFull(Class type,
Object obj)
obj が変換無しで type と一致するかを得る。
type
- 型情報obj
- 判定対象のオブジェクト
- obj が type の実体であれば true。
違えば false。
matchFullAll
public static boolean matchFullAll(Class[] types,
Object[] args)
args が変換無しで types と一致するかを得る。
types
- 型情報配列args
- 判定対象のオブジェクト配列
- args が types に一致すれば true。
違えば flase。
matchRestrict
public static boolean matchRestrict(Class type,
Object obj)
obj が type の実体であるかを得る。
type が数値を示すプリミティブ型
( byte, short, int, long, float, double のいずれか )を
であり、かつ obj がそれらのプリミティブのラッパ型、
( Byte, Short, Integer, Long, Float, Double のいずれか )
のインスタンスである場合 変換可能と判断して true を返す。
type
- 型情報obj
- 判定対象のオブジェクト
- obj が type の実体であれば true。
違えば false。
matchRestrictAll
public static boolean matchRestrictAll(Class[] types,
Object[] args)
args が Type.parse による変換を伴えば
types と一致するかを得る。
matchAll() より厳§に判定する。
types
- 型情報配列args
- 判定対象のオブジェクト配列
- args が types に一致すれば true。
違えば flase。
parse
public static Object parse(Class type,
Object obj)
Factory.match( type, obj ) でマッチした obj を
type で示される型に変換する。
type
- 変換する型情報obj
- 変換対象のオブジェクト
parseAll
public static Object[] parseAll(Class[] types,
Object[] args)
Factory.matchAll( types, args ) でマッチした args を
一括して types で示される型に変換する。
types
- 変換する型情報配列args
- 変換対象のオブジェクト配列
When you found typographical errors or omissions, Please mail to cqw10305@nifty.com
The company name and product name which are used in this document, it is the trademark or registered trademark of each company generally.
Copyright © 2001-2002 Michel Ishizuka. All Rights Reserved.