UDK 3.1.0 Java API Reference

com.sun.star.uno
クラス Type

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

public class Type
extends Object

Represents the UNO built-in type TYPE.

The UNO type is not directly mapped to java.lang.Class for at least two reasons. For one, some UNO types (like UNSIGNED SHORT) do not have a matching Java class. For another, it can be necessary to describe a type which is unknown to the Java runtime system (for example, for delaying the need of a class, so that it is possible to generate it on the fly.)

A Type is uniquely determined by its type class (a TypeClass) and its type name (a String); these two will never be null. A Type may have an additional "z class" (a java.lang.Class), giving a Java class type that corresponds to the UNO type. Also, a Type can cache a type description (a com.sun.star.uno.ITypeDescription), which can be computed and set by TypeDescription.getTypeDescription.

導入されたバージョン:
UDK1.0

フィールドの概要
protected  Class _class
           
protected  ITypeDescription _iTypeDescription
           
protected  TypeClass _typeClass
           
protected  String _typeName
           
static Type ANY
           
static Type BOOLEAN
           
static Type BYTE
           
static Type CHAR
           
static Type DOUBLE
           
static Type FLOAT
           
static Type HYPER
           
static Type LONG
           
static Type SHORT
           
static Type STRING
           
static Type TYPE
           
static Type UNSIGNED_HYPER
           
static Type UNSIGNED_LONG
           
static Type UNSIGNED_SHORT
           
static Type VOID
           
 
コンストラクタの概要
Type()
          Constructs a new Type which defaults to VOID.
Type(Class zClass)
          Constructs a new Type from the given java.lang.Class.
Type(ITypeDescription typeDescription)
          Constructs a new Type from the given type description.
Type(String typeName)
          Constructs a new Type with the given type name.
Type(String typeName, TypeClass typeClass)
          Constructs a new Type with the given type class and type name.
Type(TypeClass typeClass)
          Constructs a new Type with the given type class.
 
メソッドの概要
 boolean equals(Object obj)
           
 TypeClass getTypeClass()
          Gets the type class.
 ITypeDescription getTypeDescription()
          Gives the type description of this type.
 String getTypeName()
          Gets the type name.
 Class getZClass()
          Gets the Java class.
 int hashCode()
           
 void setTypeDescription(ITypeDescription typeDescription)
          Sets the type description for this type.
 String toString()
           
 
クラス java.lang.Object から継承したメソッド
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

VOID

public static final Type VOID

CHAR

public static final Type CHAR

BOOLEAN

public static final Type BOOLEAN

BYTE

public static final Type BYTE

SHORT

public static final Type SHORT

UNSIGNED_SHORT

public static final Type UNSIGNED_SHORT

LONG

public static final Type LONG

UNSIGNED_LONG

public static final Type UNSIGNED_LONG

HYPER

public static final Type HYPER

UNSIGNED_HYPER

public static final Type UNSIGNED_HYPER

FLOAT

public static final Type FLOAT

DOUBLE

public static final Type DOUBLE

STRING

public static final Type STRING

TYPE

public static final Type TYPE

ANY

public static final Type ANY

_typeClass

protected TypeClass _typeClass

_typeName

protected String _typeName

_class

protected Class _class

_iTypeDescription

protected ITypeDescription _iTypeDescription
コンストラクタの詳細

Type

public Type()
Constructs a new Type which defaults to VOID.

導入されたバージョン:
UDK3.0

Type

public Type(String typeName,
            TypeClass typeClass)
Constructs a new Type with the given type class and type name.

パラメータ:
typeName - the type name. Must not be null.
typeClass - the type class. Must not be null, and must match the typeName (for example, it is illegal to combine a typeName of "void" with a typeClass of BOOLEAN).

Type

public Type(Class zClass)
Constructs a new Type from the given java.lang.Class.

パラメータ:
zClass - the Java class of this type. Must not be null.
導入されたバージョン:
UDK3.0

Type

public Type(ITypeDescription typeDescription)
Constructs a new Type from the given type description.

パラメータ:
typeDescription - a type description. Must not be null.
導入されたバージョン:
UDK3.0

Type

public Type(String typeName)
Constructs a new Type with the given type name.

TODO: This constructor is dangerous, as it can create a Type with an UNKNOWN type class. It would be better if this constructor threw a IllegalArgumentException instead.

パラメータ:
typeName - the name of this type; must not be null. For simple types (VOID, BOOLEAN, CHAR, BYTE, SHORT, UNSIGNED SHORT, LONG, UNSIGNED LONG, HYPER, UNSIGNED HYPER, FLOAT, DOUBLE, STRING, TYPE, ANY), the type class is calculated; for other types, the type class is set to UNKNOWN.
導入されたバージョン:
UDK3.0

Type

public Type(TypeClass typeClass)
Constructs a new Type with the given type class.

パラメータ:
typeClass - the type class of this type; must not be null. Only type classes for simple types are allowed here.
例外:
IllegalArgumentException - if the given typeClass is not simple (for example, a struct or an interface type). This constructor could not find out the type name in such a case.
導入されたバージョン:
UDK3.0
メソッドの詳細

getTypeClass

public TypeClass getTypeClass()
Gets the type class.

戻り値:
the type class. Will never be null, but might be UNKNOWN.
導入されたバージョン:
UDK1.0

getTypeName

public String getTypeName()
Gets the type name.

戻り値:
the type name; will never be null
導入されたバージョン:
UDK1.0

getZClass

public Class getZClass()
Gets the Java class.

The implementation of com.sun.star.lib.uno.typedesc.TypeDescription (for example, getTypeDescription(Type)) seems to require that the mapping from UNO types to Java classes is an injection. Therefore, for example, the UNO type SHORT maps to the Java class short.class, but the UNO type UNSIGNED SHORT maps to null.

戻り値:
the type name; may be null in extreme situations (inconsistent TypeClass, error loading a class), or when there is no distinct Java class to represent a UNO type (so that the mapping from UNO types to Java classes is an injection)
導入されたバージョン:
UDK1.0

getTypeDescription

public ITypeDescription getTypeDescription()
Gives the type description of this type.

戻り値:
the type description; may be null
導入されたバージョン:
UDK3.0

setTypeDescription

public void setTypeDescription(ITypeDescription typeDescription)
Sets the type description for this type.

パラメータ:
typeDescription - the type description
導入されたバージョン:
UDK3.0

equals

public boolean equals(Object obj)
オーバーライド:
クラス Object 内の equals

hashCode

public int hashCode()
オーバーライド:
クラス Object 内の hashCode

toString

public String toString()
オーバーライド:
クラス Object 内の toString

UDK 3.1.0 Java API Reference