概要 | パッケージ | クラス | 使用 | 階層ツリー | 非推奨 API | 索引 | ヘルプ
| UDK 3.1.0 Java API Reference
前のクラス 次のクラス | フレームあり フレームなし
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド

## com.sun.star.uno
クラス AnyConverter

    java.lang.Object
      |
      +--com.sun.star.uno.AnyConverter

public class AnyConverter
extends Object

This class provides static methods which aim at exploring the contents of an Any and extracting its value. All public methods take an Object argument that either is the immediate object, such as Boolean, Type, interface implementation, or an Any that contains an object.
The methods which extract the value do a widening conversion. See the method comments for the respective conversions.

コンストラクタの概要
`AnyConverter()`

メソッドの概要
`static Type` | `getType(Object object)` Determines the type of an any object.
`static boolean` | `isArray(Object object)` checks if the any contains UNO idl sequence value (meaning a java array containing elements which are values of UNO idl types).
`static boolean` | `isBoolean(Object object)` checks if the any contains a value of the idl type `boolean`.
`static boolean` | `isByte(Object object)` checks if the any contains a value of the idl type `byte`.
`static boolean` | `isChar(Object object)` checks if the any contains a value of the idl type `char`.
`static boolean` | `isDouble(Object object)` checks if the any contains a value of the idl type `double`.
`static boolean` | `isEnum(Object object)` checks if the any contains a value of the idl type `enum`.
`static boolean` | `isFloat(Object object)` checks if the any contains a value of the idl type `float`.
`static boolean` | `isInt(Object object)` checks if the any contains a value of the idl type `long` (which maps to a java-int).
`static boolean` | `isLong(Object object)` checks if the any contains a value of the idl type `hyper` (which maps to a java-long).
`static boolean` | `isObject(Object object)` checks if the any contains an interface, struct, exception, sequence or enum.
`static boolean` | `isShort(Object object)` checks if the any contains a value of the idl type `short`.
`static boolean` | `isString(Object object)` checks if the any contains a value of the idl type `string`.
`static boolean` | `isType(Object object)` checks if the any contains a value of the idl type `type`.
`static boolean` | `isVoid(Object object)` checks if the any contains the idl type `void`.
`static Object` | `toArray(Object object)` converts an array or an any containing an array into an array.
`static boolean` | `toBoolean(Object object)` converts an Boolean object or an Any object containing a Boolean object into a simple boolean.
`static byte` | `toByte(Object object)` converts an Byte object or an Any object containing a Byte object into a simple byte.
`static char` | `toChar(Object object)` converts an Char object or an Any object containing a Char object into a simple char.
`static double` | `toDouble(Object object)` converts a number object into a simple double and allows widening conversions.
`static float` | `toFloat(Object object)` converts a number object into a simple float and allows widening conversions.
`static int` | `toInt(Object object)` converts a number object into a simple int and allows widening conversions.
`static long` | `toLong(Object object)` converts a number object into a simple long and allows widening conversions.
`static Object` | `toObject(Class clazz, Object object)` converts a UNO object (struct, exception, sequence, enum or interface) or an Any containing these types into an UNO object of a specified destination type.
`static Object` | `toObject(Type type, Object object)` converts a UNO object (struct, exception, sequence, enum or interface) or an Any containing these types into an UNO object of a specified destination type.
`static short` | `toShort(Object object)` converts a number object into a simple short and allows widening conversions.
`static String` | `toString(Object object)` converts a string or an any containing a string into a string.
`static Type` | `toType(Object object)` converts a Type or an any containing a Type into a Type.
`static int` | `toUnsignedInt(Object object)` converts a number object into an idl unsigned long and allows widening conversions.
`static long` | `toUnsignedLong(Object object)` converts a number object into an idl unsigned hyper and allows widening conversions.
`static short` | `toUnsignedShort(Object object)` converts a number object into an idl unsigned short and allows widening conversions.

クラス java.lang.Object から継承したメソッド
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

コンストラクタの詳細

### AnyConverter

    public AnyConverter()

メソッドの詳細

### getType

    public static Type getType(Object object)

  Determines the type of an any object.

  パラメータ:
    `object` - any object
  戻り値:
    type object

### isVoid

    public static boolean isVoid(Object object)

  checks if the any contains the idl type `void`.

  パラメータ:
    `object` - the object to check
  戻り値:
    true when the any is void, false otherwise

### isChar

    public static boolean isChar(Object object)

  checks if the any contains a value of the idl type `char`.

  パラメータ:
    `object` - the object to check
  戻り値:
    true when the any contains a char, false otherwise.

### isBoolean

    public static boolean isBoolean(Object object)

  checks if the any contains a value of the idl type `boolean`.

  パラメータ:
    `object` - the object to check
  戻り値:
    true when the any contains a boolean, false otherwise.

### isByte

    public static boolean isByte(Object object)

  checks if the any contains a value of the idl type `byte`.

  パラメータ:
    `object` - the object to check
  戻り値:
    true when the any contains a byte, false otherwise.

### isShort

    public static boolean isShort(Object object)

  checks if the any contains a value of the idl type `short`.

  パラメータ:
    `object` - the object to check
  戻り値:
    true when the any contains a short, false otherwise.

### isInt

    public static boolean isInt(Object object)

  checks if the any contains a value of the idl type `long` (which maps to a java-int).

  パラメータ:
    `object` - the object to check
  戻り値:
    true when the any contains a int, false otherwise.

### isLong

    public static boolean isLong(Object object)

  checks if the any contains a value of the idl type `hyper` (which maps to a java-long).

  パラメータ:
    `object` - the object to check
  戻り値:
    true when the any contains a long, false otherwise.

### isFloat

    public static boolean isFloat(Object object)

  checks if the any contains a value of the idl type `float`.

  パラメータ:
    `object` - the object to check
  戻り値:
    true when the any contains a float, false otherwise.

### isDouble

    public static boolean isDouble(Object object)

  checks if the any contains a value of the idl type `double`.

  パラメータ:
    `object` - the object to check
  戻り値:
    true when the any contains a double, false otherwise.

### isString

    public static boolean isString(Object object)

  checks if the any contains a value of the idl type `string`.

  パラメータ:
    `object` - the object to check
  戻り値:
    true when the any contains a string, false otherwise.

### isEnum

    public static boolean isEnum(Object object)

  checks if the any contains a value of the idl type `enum`.

  パラメータ:
    `object` - the object to check
  戻り値:
    true if the any contains an enum, false otherwise

### isType

    public static boolean isType(Object object)

  checks if the any contains a value of the idl type `type`.

  パラメータ:
    `object` - the object to check
  戻り値:
    true when the any contains a type, false otherwise.

### isObject

    public static boolean isObject(Object object)

  checks if the any contains an interface, struct, exception, sequence or enum. If object is an any with an interface type, then true is also returned if the any contains a null reference. This is because interfaces are allowed to have a null value contrary to other UNO types.

  パラメータ:
    `object` - the object to check
  戻り値:
    true if the any contains an object

### isArray

    public static boolean isArray(Object object)

  checks if the any contains UNO idl sequence value (meaning a java array containing elements which are values of UNO idl types).

  パラメータ:
    `object` - the object to check
  戻り値:
    true when the any contains an object which implements interfaces, false otherwise.

### toChar

    public static char toChar(Object object)
                       throws IllegalArgumentException

  converts an Char object or an Any object containing a Char object into a simple char.

  パラメータ:
    `object` - the object to convert
  戻り値:
    the char contained within the object
  例外:
    `IllegalArgumentException` - in case no char is contained within object
  関連項目:
    `isChar(java.lang.Object)`

### toBoolean

    public static boolean toBoolean(Object object)
                             throws IllegalArgumentException

  converts an Boolean object or an Any object containing a Boolean object into a simple boolean.

  パラメータ:
    `object` - the object to convert
  戻り値:
    the boolean contained within the object
  例外:
    `IllegalArgumentException` - in case no boolean is contained within object
  関連項目:
    `isBoolean(java.lang.Object)`

### toByte

    public static byte toByte(Object object)
                       throws IllegalArgumentException

  converts an Byte object or an Any object containing a Byte object into a simple byte.

  パラメータ:
    `object` - the object to convert
  戻り値:
    the boolean contained within the object
  例外:
    `IllegalArgumentException` - in case no byte is contained within object
  関連項目:
    `isBoolean(java.lang.Object)`

### toShort

    public static short toShort(Object object)
                         throws IllegalArgumentException

  converts a number object into a simple short and allows widening conversions. Allowed argument types are Byte, Short or Any containing these types.

  パラメータ:
    `object` - the object to convert
  戻り値:
    the short contained within the object
  例外:
    `IllegalArgumentException` - in case no short or byte is contained within object

### toUnsignedShort

    public static short toUnsignedShort(Object object)
                                 throws IllegalArgumentException

  converts a number object into an idl unsigned short and allows widening conversions. Allowed argument types are Anies containing idl unsigned short values.

  パラメータ:
    `object` - the object to convert
  戻り値:
    an (unsigned) short
  例外:
    `IllegalArgumentException` - in case no idl unsigned short is contained within Any

### toInt

    public static int toInt(Object object)
                     throws IllegalArgumentException

  converts a number object into a simple int and allows widening conversions. Allowed argument types are Byte, Short, Integer or Any containing these types.

  パラメータ:
    `object` - the object to convert
  戻り値:
    the int contained within the object
  例外:
    `IllegalArgumentException` - in case no short, byte or int is contained within object.

### toUnsignedInt

    public static int toUnsignedInt(Object object)
                             throws IllegalArgumentException

  converts a number object into an idl unsigned long and allows widening conversions. Allowed argument types are Anies containing idl unsigned short or unsigned long values.

  パラメータ:
    `object` - the object to convert
  戻り値:
    an (unsigned) int
  例外:
    `IllegalArgumentException` - in case no idl unsigned short nor unsigned long is contained within Any

### toLong

    public static long toLong(Object object)
                       throws IllegalArgumentException

  converts a number object into a simple long and allows widening conversions. Allowed argument types are Byte, Short, Integer, Long or Any containing these types.

  パラメータ:
    `object` - the object to convert
  戻り値:
    the long contained within the object
  例外:
    `IllegalArgumentException` - in case no short, byte, int or long is contained within object.

### toUnsignedLong

    public static long toUnsignedLong(Object object)
                               throws IllegalArgumentException

  converts a number object into an idl unsigned hyper and allows widening conversions. Allowed argument types are Anies containing idl unsigned short, unsigned long or unsigned hyper values.

  パラメータ:
    `object` - the object to convert
  戻り値:
    an (unsigned) long
  例外:
    `IllegalArgumentException` - in case no idl unsigned short, nor unsigned long nor unsigned hyper is contained within object.

### toFloat

    public static float toFloat(Object object)
                         throws IllegalArgumentException

  converts a number object into a simple float and allows widening conversions. Allowed argument types are Byte, Short, Float or Any containing these types.

  パラメータ:
    `object` - the object to convert
  戻り値:
    the float contained within the object
  例外:
    `IllegalArgumentException` - in case no byte, short or float is contained within object.

### toDouble

    public static double toDouble(Object object)
                           throws IllegalArgumentException

  converts a number object into a simple double and allows widening conversions. Allowed argument types are Byte, Short, Int, Float, Double or Any containing these types.

  パラメータ:
    `object` - the object to convert
  戻り値:
    the double contained within the object
  例外:
    `IllegalArgumentException` - in case no byte, short, int, float or double is contained within object.

### toString

    public static String toString(Object object)
                           throws IllegalArgumentException

  converts a string or an any containing a string into a string.

  パラメータ:
    `object` - the object to convert
  戻り値:
    the string contained within the object
  例外:
    `IllegalArgumentException` - in case no string is contained within object.

### toType

    public static Type toType(Object object)
                       throws IllegalArgumentException

  converts a Type or an any containing a Type into a Type.

  パラメータ:
    `object` - the object to convert
  戻り値:
    the type contained within the object
  例外:
    `IllegalArgumentException` - in case no type is contained within object.

### toObject

    public static Object toObject(Type type,
                                  Object object)
                           throws IllegalArgumentException

  converts a UNO object (struct, exception, sequence, enum or interface) or an Any containing these types into an UNO object of a specified destination type. For interfaces, the argument object is queried for the interface specified by the type argument. That query (UnoRuntime.queryInterface) might return null, if the interface is not implemented or a null-ref or a VOID any is given.

  パラメータ:
    `type` - type of the returned value
    `object` - the object that is to be converted
  戻り値:
    destination object
  例外:
    `IllegalArgumentException` - in case conversion is not possible

### toObject

    public static Object toObject(Class clazz,
                                  Object object)
                           throws IllegalArgumentException

  converts a UNO object (struct, exception, sequence, enum or interface) or an Any containing these types into an UNO object of a specified destination type. For interfaces, the argument object is queried for the interface specified by the type argument. That query (UnoRuntime.queryInterface) might return null, if the interface is not implemented or a null-ref or a VOID any is given.

  パラメータ:
    `clazz` - class of the returned value
    `object` - the object that is to be converted
  戻り値:
    destination object
  例外:
    `IllegalArgumentException` - in case conversion is not possible

### toArray

    public static Object toArray(Object object)
                          throws IllegalArgumentException

  converts an array or an any containing an array into an array.

  パラメータ:
    `object` - the object to convert
  戻り値:
    the array contained within the object
  例外:
    `IllegalArgumentException` - in case no array is contained within object.

概要 | パッケージ | クラス | 使用 | 階層ツリー | 非推奨 API | 索引 | ヘルプ
| UDK 3.1.0 Java API Reference
前のクラス 次のクラス | フレームあり フレームなし
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド