|
Gephi Toolkit Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gephi.data.attributes.type.TypeConvertor
public final class TypeConvertor
Class responsible for type manipulation and creation needed in Attributes API.
Method Summary | ||
---|---|---|
static
|
convertPrimitiveToWrapperArray(java.lang.Object primitiveArray)
Converts given array of primitive type into array of wrapper type. |
|
static
|
createArrayFromString(java.lang.String input,
java.lang.String separator,
java.lang.Class<T> finalType)
Creates array of given type from single String value. |
|
static
|
createInstanceFromString(java.lang.String input,
java.lang.Class<T> finalType)
Transforms String value to any kind of object with given type. |
|
static AttributeType |
getDynamicType(AttributeType staticType)
Returns the corresponding dynamic type from staticType For example
returns DYNAMIC_FLOAT if given type is FLOAT . |
|
static AttributeType |
getStaticType(AttributeType dynamicType)
Returns the underlying static type from dynamicType For example
returns FLOAT if given type is DYNAMIC_FLOAT . |
|
static java.lang.Class<?> |
getWrapperFromPrimitive(java.lang.Class<?> primitiveType)
Returns wrapper type from given primitive type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T> T[] createArrayFromString(java.lang.String input, java.lang.String separator, java.lang.Class<T> finalType)
createInstanceFromString
method.
T
- type parameter representing final array typeinput
- inputseparator
- separator which will be used in the process of tokenizing inputfinalType
- type of final array
java.lang.NullPointerException
- if any of given parameters is null
java.lang.IllegalArgumentException
- if array of given type cannot be createdcreateInstanceFromString
public static <T> T createInstanceFromString(java.lang.String input, java.lang.Class<T> finalType)
T
- type parameter representing final typeinput
- inputfinalType
- type of final object
java.lang.NullPointerException
- if any of given parameters is null
java.lang.IllegalArgumentException
- if given type cannot be createdpublic static <T> T[] convertPrimitiveToWrapperArray(java.lang.Object primitiveArray)
T
- type parameter representing final wrapper typeprimitiveArray
- primitive array
java.lang.NullPointerException
- if given parameter is null
java.lang.IllegalArgumentException
- if given parameter is not array or given parameter is not
array of primitive typepublic static java.lang.Class<?> getWrapperFromPrimitive(java.lang.Class<?> primitiveType)
primitiveType
- primitive type
java.lang.NullPointerException
- if given parameter is null
java.lang.IllegalArgumentException
- if given parameter is not a primitive typepublic static AttributeType getStaticType(AttributeType dynamicType)
dynamicType
For example
returns FLOAT
if given type is DYNAMIC_FLOAT
.
dynamicType
- a dynamic type
java.lang.IllegalArgumentException
- if dynamicType
is not dynamicpublic static AttributeType getDynamicType(AttributeType staticType)
staticType
For example
returns DYNAMIC_FLOAT
if given type is FLOAT
.
staticType
- a static type
java.lang.IllegalArgumentException
- if staticType
is not static
|
Gephi Toolkit Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |