javax.rad.type
Class ArrayType

java.lang.Object
  extended by javax.rad.type.AbstractType<Object[]>
      extended by javax.rad.type.ArrayType
All Implemented Interfaces:
IType<Object[]>

public class ArrayType
extends AbstractType<Object[]>

The ArrayType is a platform independent definition of an array.


Field Summary
 
Fields inherited from interface javax.rad.type.IType
UNKNOWN_TYPE
 
Constructor Summary
ArrayType()
          Constructs a new ArrayType.
ArrayType(IType<?> pComponentType)
          Constructs a new ArrayType.
 
Method Summary
 int compareTo(Object[] pObject1, Object pObject2)
          Compares two objects.
 Object get(Object pObject)
          Gets the length.
 IType<?> getComponentType()
          Gets the component type.
 int getLength(Object pObject)
          Gets the length.
 Class<Object[]> getTypeClass()
          Returns the class used by this type.
 Object[] valueOf(Object pObject)
          Converts the object to an Object which is an instance of type class.
 
Methods inherited from class javax.rad.type.AbstractType
equals, getTypeFromClass, getTypeFromObject, hashCode, registerType, toString, validatedValueOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayType

public ArrayType()
Constructs a new ArrayType.


ArrayType

public ArrayType(IType<?> pComponentType)
Constructs a new ArrayType.

Parameters:
pComponentType - the component type.
Method Detail

getTypeClass

public Class<Object[]> getTypeClass()
Returns the class used by this type.

Returns:
the class used by this type.

valueOf

public Object[] valueOf(Object pObject)
Converts the object to an Object which is an instance of type class.

Specified by:
valueOf in interface IType<Object[]>
Overrides:
valueOf in class AbstractType<Object[]>
Parameters:
pObject - the Object to convert
Returns:
the Object which is an instance of type class.

compareTo

public int compareTo(Object[] pObject1,
                     Object pObject2)
Compares two objects. If the first object is smaller than the second object a value < 0 is returned. If the two objects are equal than 0 is returned. If the first object is greater than the second object a value > 0 is returned.

Parameters:
pObject1 - the first object.
pObject2 - the second object.
Returns:
< 0 if pObject1 is smaller, 0 if equal and > 0 if it is greater then pObject2

getComponentType

public IType<?> getComponentType()
Gets the component type.

Returns:
the component type.

getLength

public int getLength(Object pObject)
Gets the length.

Parameters:
pObject - the array.
Returns:
the length.

get

public Object get(Object pObject)
Gets the length.

Parameters:
pObject - the array.
Returns:
the length.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.