Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1.7.0)

E12063-08

oracle.dss.util
Class Utility

java.lang.Object
  extended by oracle.dss.util.Utility

public class Utility
extends java.lang.Object

For internal use only. Application developers should not use this
Generic static utility functions and constants.

Nested Class Summary
static class Utility.PropertyType
           
 
Field Summary
static char SC_FALSE
           
static char SC_TRUE
           
static int SPACE_UNDERLINE
           
static int START_UNDERLINE
           
 
Constructor Summary
Utility()
           
 
Method Summary
static java.lang.Object[] arraycopy(java.lang.Object[] src)
          Copy an array even with a null destination.
static java.lang.Object[][] arraycopy(java.lang.Object[][] src)
          Copy a two dimensional Object array.
static java.lang.String arrayToString(java.lang.Object array)
          Generate a string representation of an array of objects.
static java.lang.Object checkAndConvertJBONumber(java.lang.Object value)
           
static java.lang.Object checkAndConvertJBOTimestamp(java.lang.Object value)
           
static java.util.Hashtable cloneHashtable(java.util.Hashtable t)
          Copy a hashtable of cloneable objects
static java.util.Vector cloneVector(java.util.Vector v)
          Copy a given vector by actually cloning each element.
static java.lang.String[] combineArrays(java.lang.String[] one, java.lang.String[] two)
          Combine two string arrays into one
static boolean compareArrays(java.lang.Object[] list1, java.lang.Object[] list2)
          Compare two arrays and return true if they are exactly equal
static int compareAsNumbers(java.lang.Object obj1, java.lang.Object obj2)
          Compares the numeric values of the two Object Utility method to handle the fact that it is not possible to use the Comparable interface to compare different numeric types
static boolean compareHashMap(java.util.HashMap table1, java.util.HashMap table2)
          Compare two hashtables
static boolean compareHashtables(java.util.Hashtable table1, java.util.Hashtable table2)
          Compare two hashtables
static boolean compareLists(java.util.List list1, java.util.List list2)
           
static boolean compareLists(java.lang.String[] list1, java.lang.String[] list2)
          Compare two string arrays and return true if they are exactly equal except for order
static boolean compareListsExact(java.lang.String[] list1, java.lang.String[] list2)
          Compare two string arrays and return true if they are exactly equal
static boolean compareObj(java.lang.Object obj1, java.lang.Object obj2)
          Test two Objects for equality accounting for the possibility of nulls.
static boolean compareVectors(java.util.Vector v1, java.util.Vector v2)
          Compare two Vectors for a deep match.
static boolean compareVersionStrings(java.lang.String version1, java.lang.String version2)
           
static int compareXMLVersions(java.lang.String ver1, java.lang.String ver2)
           
static boolean contains(java.util.Vector vector1, java.util.Vector vector2)
           
static java.util.Vector copyArrayToVector(java.lang.Object[] array)
          Put the contents of an array into a vector and return it
static java.lang.Object[] copyVectorToArray(java.util.Vector vector)
           
static java.lang.Object[] copyVectorToArray(java.util.Vector vObjects, java.lang.Class classBase)
           
static java.lang.String escapeStateString(java.lang.String str, char[] escapeChars, char[] replaceChars, char escapeChar)
           
static java.lang.String[] flattenArray(java.lang.String[][] twod)
          Flatten a two dimensional string array into a linear array
static char getBooleanAsChar(boolean value)
           
static java.util.Vector getDependentID(oracle.dss.util.persistence.XMLContext context, java.util.Vector ids, boolean onlyIfMeasureDim, java.lang.String dim)
           
static oracle.dss.util.persistence.GUIDConverter getGUIDConverter(oracle.dss.util.persistence.XMLContext context)
           
static IDResolver getIDResolver(oracle.dss.util.persistence.XMLContext context)
           
static java.lang.Object getJavaValue(java.lang.Object value)
           
static java.lang.String getMeasureDimName(oracle.dss.util.persistence.XMLContext context)
           
static java.lang.Object getMigrationFlag(oracle.dss.util.persistence.XMLContext context)
           
static boolean getValueAsBoolean(oracle.dss.util.xml.PropertyNode node)
           
static java.lang.Object instantiateClass(java.lang.String strClassName, java.lang.Class[] classConstructorArgs, java.lang.Object[] objectArgs, ErrorHandler eh)
           
static boolean isDateType(java.lang.Object obj)
           
static boolean isJavaClassNumberType(java.lang.Class cl)
           
static boolean isJavaNumberType(java.lang.Object obj)
           
static boolean isJboClassNumberType(java.lang.Class cl)
           
static boolean isJboNumberType(java.lang.Object obj)
           
static boolean isStringType(java.lang.Object obj)
           
static java.lang.Class loadClass(java.lang.String a_classname)
           
static java.lang.String ObjectToString(java.lang.Object object)
          Converts a object to a string.
static void setDependentID(oracle.dss.util.persistence.XMLContext context, java.util.Vector ids, boolean onlyIfMeasureDim, java.lang.String dim)
           
static java.lang.Object StringToObject(java.lang.String string)
          Converts a string to a object.
static java.lang.String unescapeStateString(java.lang.String str, char[] escapeChars, char[] replaceChars, char escapeChar)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

START_UNDERLINE

public static final int START_UNDERLINE
See Also:
Constant Field Values
For internal use only. Application developers should not use this
Underline starting point vertically.

SPACE_UNDERLINE

public static final int SPACE_UNDERLINE
See Also:
Constant Field Values
For internal use only. Application developers should not use this
Space between double underlines.

SC_TRUE

public static final char SC_TRUE
See Also:
Constant Field Values

SC_FALSE

public static final char SC_FALSE
See Also:
Constant Field Values
Constructor Detail

Utility

public Utility()
Method Detail

cloneVector

public static java.util.Vector cloneVector(java.util.Vector v)
                                    throws java.lang.CloneNotSupportedException
Copy a given vector by actually cloning each element. Note the elements must support the VectorClone interface as well as be Cloneable.

Parameters:
v - vector to copy
return - copy of vector v
Throws:
java.lang.CloneNotSupportedException - thrown if there is a problem cloning the elements

cloneHashtable

public static java.util.Hashtable cloneHashtable(java.util.Hashtable t)
                                          throws java.lang.CloneNotSupportedException
Copy a hashtable of cloneable objects

Parameters:
src - source table
Returns:
deep copy of table
Throws:
java.lang.CloneNotSupportedException - thrown if there is a problem cloning the elements

compareLists

public static boolean compareLists(java.util.List list1,
                                   java.util.List list2)

compareArrays

public static boolean compareArrays(java.lang.Object[] list1,
                                    java.lang.Object[] list2)
Compare two arrays and return true if they are exactly equal

Parameters:
list1 - first list to compare
list2 - second list to compare
Returns:
true if the lists' contents are equal

compareHashtables

public static boolean compareHashtables(java.util.Hashtable table1,
                                        java.util.Hashtable table2)
Compare two hashtables

Parameters:
table1 - first table
table2 - second table
Returns:
true if hash tables are equal (each object within them is equal and found in the same order)

compareHashMap

public static boolean compareHashMap(java.util.HashMap table1,
                                     java.util.HashMap table2)
Compare two hashtables

Parameters:
table1 - first table
table2 - second table
Returns:
true if hash tables are equal (each object within them is equal and found in the same order)

arraycopy

public static java.lang.Object[][] arraycopy(java.lang.Object[][] src)
Copy a two dimensional Object array.

Parameters:
src - source array
Returns:
copy of array

arraycopy

public static java.lang.Object[] arraycopy(java.lang.Object[] src)
Copy an array even with a null destination.

Parameters:
src - source array
Returns:
copy of array

copyVectorToArray

public static java.lang.Object[] copyVectorToArray(java.util.Vector vector)
Parameters:
vObjects - A Vector of objects to put into an array.
Returns:
Object array containing the vector's contents.
Throws:
java.lang.ArrayStoreException - if the objects in the vector are not all of the same type.
For internal use only. Application developers should not use this
Put the contents of a vector into an array and return it.

copyVectorToArray

public static java.lang.Object[] copyVectorToArray(java.util.Vector vObjects,
                                                   java.lang.Class classBase)
Parameters:
vObjects - A Vector of objects to put into an array.
classBase - The Class of the returned Object array.
Returns:
Object array of classBase objects containing the vector's contents.
Throws:
java.lang.ArrayStoreException - if the objects in the vector do not share the same classBase.
For internal use only. Application developers should not use this
Put the contents of a vector into an array and return it.

copyArrayToVector

public static java.util.Vector copyArrayToVector(java.lang.Object[] array)
Put the contents of an array into a vector and return it

Parameters:
array - array contents to put into a vector
Returns:
Vector containing array contents

compareVectors

public static boolean compareVectors(java.util.Vector v1,
                                     java.util.Vector v2)
Compare two Vectors for a deep match. Assumes that the elements within those vectors can correctly compare themselves using the equals() method.

Parameters:
v1 - first Vector to compare
v2 - second Vector to compare
Returns:
true if Vectors and all their elements are equal

compareLists

public static boolean compareLists(java.lang.String[] list1,
                                   java.lang.String[] list2)
Compare two string arrays and return true if they are exactly equal except for order

Parameters:
list1 - first list to compare
list2 - second list to compare
Returns:
true if the lists' contents are equal

compareListsExact

public static boolean compareListsExact(java.lang.String[] list1,
                                        java.lang.String[] list2)
Compare two string arrays and return true if they are exactly equal

Parameters:
list1 - first list to compare
list2 - second list to compare
Returns:
true if the lists' contents are equal

combineArrays

public static java.lang.String[] combineArrays(java.lang.String[] one,
                                               java.lang.String[] two)
Combine two string arrays into one

Parameters:
one - first array to combine
two - second array to combine
Returns:
arrays combined with one first and two second

flattenArray

public static java.lang.String[] flattenArray(java.lang.String[][] twod)
Flatten a two dimensional string array into a linear array

Parameters:
twod - input two dimensional array
Returns:
flattened one dimensional array

arrayToString

public static java.lang.String arrayToString(java.lang.Object array)
Generate a string representation of an array of objects.

Parameters:
array - a Object value that represents an array of objects.
Returns:
String which represents the string representation of our object array, or null.

ObjectToString

public static java.lang.String ObjectToString(java.lang.Object object)
Converts a object to a string.

Parameters:
object - a Object that represents the value we wish to convert to a string.
Returns:
Object which represents the string representation of the specified object, or null.

StringToObject

public static java.lang.Object StringToObject(java.lang.String string)
Converts a string to a object.

Parameters:
string - a String that represents the value we wish to convert to a object.
Returns:
Object which represents the object representation of the specified string, or null.

instantiateClass

public static java.lang.Object instantiateClass(java.lang.String strClassName,
                                                java.lang.Class[] classConstructorArgs,
                                                java.lang.Object[] objectArgs,
                                                ErrorHandler eh)
Parameters:
strClassName - a String value that represents the class name of the object we are trying to create.
classConstructorArgs - a Class array that contains the arguments that will be passed to the class's getConstructor method.
objectArgs - an Object array that contains the arguments that will be passed to our output object's constructor.
Returns:
Object which represents our newly instantiated object, or null.
For internal use only. Application developers should not use this
Generates an instance of a class from the given class name.

contains

public static boolean contains(java.util.Vector vector1,
                               java.util.Vector vector2)
Parameters:
vector1 - Vector which might contain the elements from the second Vector
vector2 - Vector whose elements are supposedly contained by the first Vector
Returns:
true if all the elements of the second Vector are contained by the first vector
For internal use only. Application developers should not use this
Checks if one vector contains all the elements of the other vector

compareObj

public static boolean compareObj(java.lang.Object obj1,
                                 java.lang.Object obj2)
Test two Objects for equality accounting for the possibility of nulls.

Parameters:
obj1 - Object to compare 1
obj2 - Object to compare 2
Returns:
true if Objects are equal

compareAsNumbers

public static int compareAsNumbers(java.lang.Object obj1,
                                   java.lang.Object obj2)
Compares the numeric values of the two Object Utility method to handle the fact that it is not possible to use the Comparable interface to compare different numeric types


compareXMLVersions

public static int compareXMLVersions(java.lang.String ver1,
                                     java.lang.String ver2)
Parameters:
ver1 - a String representation of an XML version number, for instance as it appears in the XML (e.g.- "1.7.0.6")
ver2 - the second XML version number
Returns:
-1 if ver1 < ver2, 0 if ver1 == ver2, or 1 if ver1 > ver2
For internal use only. Application developers should not use this
Compare two XML version numbers.

escapeStateString

public static java.lang.String escapeStateString(java.lang.String str,
                                                 char[] escapeChars,
                                                 char[] replaceChars,
                                                 char escapeChar)
For internal use only. Application developers should not use this
Escapes characters in the given string

unescapeStateString

public static java.lang.String unescapeStateString(java.lang.String str,
                                                   char[] escapeChars,
                                                   char[] replaceChars,
                                                   char escapeChar)
For internal use only. Application developers should not use this
Unescapes characters in the given string

setDependentID

public static void setDependentID(oracle.dss.util.persistence.XMLContext context,
                                  java.util.Vector ids,
                                  boolean onlyIfMeasureDim,
                                  java.lang.String dim)
For internal use only. Application developers should not use this
Informs the ID resolver for system aggregates of the ids for the objects that need system aggregating

getDependentID

public static java.util.Vector getDependentID(oracle.dss.util.persistence.XMLContext context,
                                              java.util.Vector ids,
                                              boolean onlyIfMeasureDim,
                                              java.lang.String dim)
For internal use only. Application developers should not use this
Convert the given list of ids (or paths) into proper GUIDs at load time

getMeasureDimName

public static java.lang.String getMeasureDimName(oracle.dss.util.persistence.XMLContext context)
For internal use only. Application developers should not use this
Retrieve the ID of the measure dimension, if available

getIDResolver

public static IDResolver getIDResolver(oracle.dss.util.persistence.XMLContext context)
For internal use only. Application developers should not use this
Return the system aggregate ID resolver, if available

getMigrationFlag

public static java.lang.Object getMigrationFlag(oracle.dss.util.persistence.XMLContext context)
For internal use only. Application developers should not use this
Retrieve the migration flag, if available

getGUIDConverter

public static oracle.dss.util.persistence.GUIDConverter getGUIDConverter(oracle.dss.util.persistence.XMLContext context)
For internal use only. Application developers should not use this
Retrieve the GUID converter if available

compareVersionStrings

public static boolean compareVersionStrings(java.lang.String version1,
                                            java.lang.String version2)

loadClass

public static java.lang.Class loadClass(java.lang.String a_classname)
                                 throws java.lang.ClassNotFoundException
Parameters:
String - which represents the class to be loaded.
Returns:
Class which represents the requested class object
Throws:
java.lang.ClassNotFoundException
For internal use only. Application developers should not use this
Given a non-null class name, this method loads the class. This method searches application classes first in a J2EE environment. If the class is not found, it throws ClassNotFoundException.

getBooleanAsChar

public static char getBooleanAsChar(boolean value)

getValueAsBoolean

public static boolean getValueAsBoolean(oracle.dss.util.xml.PropertyNode node)

isDateType

public static boolean isDateType(java.lang.Object obj)

isJavaNumberType

public static boolean isJavaNumberType(java.lang.Object obj)

isJavaClassNumberType

public static boolean isJavaClassNumberType(java.lang.Class cl)

isJboNumberType

public static boolean isJboNumberType(java.lang.Object obj)

isJboClassNumberType

public static boolean isJboClassNumberType(java.lang.Class cl)

isStringType

public static boolean isStringType(java.lang.Object obj)

getJavaValue

public static java.lang.Object getJavaValue(java.lang.Object value)

checkAndConvertJBOTimestamp

public static java.lang.Object checkAndConvertJBOTimestamp(java.lang.Object value)

checkAndConvertJBONumber

public static java.lang.Object checkAndConvertJBONumber(java.lang.Object value)

Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1.7.0)

E12063-08

Copyright © 1997, 2013, Oracle. All rights reserved.