Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.13
UNO Java Runtime

com.sun.star.uno
Class Type

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

public class Type
extends java.lang.Object

The Type class represents the IDL builtin type type.

The IDL type is not directly mapped to java.lang.Class, because it can be necessary to describe a type which is unknown to the java runtime system, e.g. for delaying the need of a class, so that it is possible to generate it on the fly.

Since:
UDK1.0

Field Summary
protected  java.lang.Class _class
           
protected  ITypeDescription _iTypeDescription
           
protected  TypeClass _typeClass
           
protected  java.lang.String _typeName
           
 
Constructor Summary
Type()
          Constructs a new Type which defaults to void
Type(java.lang.Class zClass)
          Constructs a new Type with the given class.
Type(ITypeDescription iTypeDescription)
          Constructs a new Type with the given type description.
Type(java.lang.String typeName)
          Constructs a new Type with the given type name.
Type(TypeClass typeClass)
          Constructs a new Type with the given TypeClass.
 
Method Summary
 boolean equals(java.lang.Object object)
          Compares two types.
 TypeClass getTypeClass()
          Gets the typeClass.
 ITypeDescription getTypeDescription()
          Gives the type description of this type.
 java.lang.String getTypeName()
          Gets the type name.
 java.lang.Class getZClass()
          Gets the java class.
 int hashCode()
          Calculates the hash code.
 void setTypeDescription(ITypeDescription iTypeDescription)
          Sets the type description for this type.
 java.lang.String toString()
          Constructs a descriptive String for the type.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_typeName

protected java.lang.String _typeName

_class

protected java.lang.Class _class

_typeClass

protected TypeClass _typeClass

_iTypeDescription

protected ITypeDescription _iTypeDescription
Constructor Detail

Type

public Type()
Constructs a new Type which defaults to void

Since:
UDK3.0

Type

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

Parameters:
zClass - the java class of this type
Since:
UDK3.0

Type

public Type(ITypeDescription iTypeDescription)
Constructs a new Type with the given type description.

Since:
UDK3.0

Type

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

Parameters:
typeName - the name of this type. For simple types (numbers,string,type,any), the typeclass is calculated, for complex types (structs,interfaces), the typeclass of this object is set to UNKNOWN
Since:
UDK3.0

Type

public Type(TypeClass typeClass)
     throws java.lang.IllegalArgumentException
Constructs a new Type with the given TypeClass.

Parameters:
typeClass - the TypeClass of this type. Only typeclass for simple types is allowed.
Throws:
java.lang.IllegalArgumentException - when the typeClass is not simple (e.g. a struct or an interface. The Constructor cannot find out the name of the type in this case.
Since:
UDK3.0
Method Detail

getTypeDescription

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

Returns:
the type description
Since:
UDK3.0

setTypeDescription

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

Returns:
the type description
Since:
UDK3.0

getTypeName

public java.lang.String getTypeName()
Gets the type name. Returns null if this type has not been constructed by name.

Returns:
the type name.
Since:
UDK1.0

getZClass

public java.lang.Class getZClass()
Gets the java class. Returns null if this type has not been constructed by Class.

Returns:
the type name. Maybe null.
Since:
UDK1.0

getTypeClass

public TypeClass getTypeClass()
Gets the typeClass. Returns null if this type has not been constructed by TypeClass.

Returns:
the type class. May be TypeClass.UNKNOWN.
Since:
UDK1.0

equals

public boolean equals(java.lang.Object object)
Compares two types.

Overrides:
equals in class java.lang.Object
Returns:
true, if the given type and this type are equal

hashCode

public int hashCode()
Calculates the hash code.

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code

toString

public java.lang.String toString()
Constructs a descriptive String for the type.

Overrides:
toString in class java.lang.Object
Returns:
a descriptive String

UNO Java Runtime

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.