Qizx/open API

net.axyana.qizxopen.util
Class Util

java.lang.Object
  extended bynet.axyana.qizxopen.util.Util

public class Util
extends java.lang.Object

A collection of static utility methods.


Field Summary
static java.lang.String HEX
           
static java.lang.String IRI_KEPT
           
static java.lang.String URI_KEPT
           
 
Constructor Summary
Util()
           
 
Method Summary
static java.lang.String camelCase(java.lang.String name, boolean capitalize)
          Converts a name to 'camelCase': hyphens are removed, letters following hyphens are converted to uppercase.
static int changeFlag(int mask, int flag, boolean set)
           
static int clearFlag(int mask, int flag)
           
static int comparison(double diff)
           
static int comparison(int diff)
           
static int countBitsInMask(int mask)
           
static void dumpBytes(byte[] bytes, int maxLen)
           
static java.lang.String encodeForURI(java.lang.String uri)
           
static java.lang.String escapeHtmlURI(java.lang.String uri)
           
static void fprintf(java.io.PrintStream out, char[] buffer)
           
static java.lang.Object getProp(java.util.Map properties, java.lang.String name, java.lang.Class classe, java.lang.Object defaultValue)
           
static java.lang.String getStringProp(java.util.Map properties, java.lang.String name, java.lang.String defaultValue)
           
static java.lang.String iriToURI(java.lang.String uri)
           
static boolean isRemote(java.lang.Object object)
          Returns true if the object is a handle to a RMI remote object.
static java.lang.String normalizePath(java.lang.String path, boolean absolute)
          Normalizes a path.
static java.lang.String pathLastName(java.lang.String path)
          Returns the last element of a path.
static java.lang.String pathParent(java.lang.String path)
          Returns the path which "contains" a path.
static void printf(char[] buffer)
           
static java.util.Properties properties(java.lang.Class classe, java.lang.String name)
           
static int setFlag(int mask, int flag)
           
static void sleep(int time)
          Sleep without this annoying exception.
static boolean testFlag(int mask, int flag)
           
static java.lang.String toHex(int h, int minDigit)
           
static java.net.URL uriToURL(java.lang.String uri)
          Converts a relative or absolute path or an uri to an absolute URL
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEX

public static final java.lang.String HEX
See Also:
Constant Field Values

URI_KEPT

public static final java.lang.String URI_KEPT
See Also:
Constant Field Values

IRI_KEPT

public static final java.lang.String IRI_KEPT
See Also:
Constant Field Values
Constructor Detail

Util

public Util()
Method Detail

printf

public static void printf(char[] buffer)

fprintf

public static void fprintf(java.io.PrintStream out,
                           char[] buffer)

toHex

public static java.lang.String toHex(int h,
                                     int minDigit)

setFlag

public static int setFlag(int mask,
                          int flag)

changeFlag

public static int changeFlag(int mask,
                             int flag,
                             boolean set)

clearFlag

public static int clearFlag(int mask,
                            int flag)

testFlag

public static boolean testFlag(int mask,
                               int flag)

comparison

public static int comparison(int diff)

comparison

public static int comparison(double diff)

camelCase

public static java.lang.String camelCase(java.lang.String name,
                                         boolean capitalize)
Converts a name to 'camelCase': hyphens are removed, letters following hyphens are converted to uppercase. Initial letter converted to uppercase if 'capitalize'. eg: this-to-that becomes ThisToThat


properties

public static java.util.Properties properties(java.lang.Class classe,
                                              java.lang.String name)

getProp

public static java.lang.Object getProp(java.util.Map properties,
                                       java.lang.String name,
                                       java.lang.Class classe,
                                       java.lang.Object defaultValue)

getStringProp

public static java.lang.String getStringProp(java.util.Map properties,
                                             java.lang.String name,
                                             java.lang.String defaultValue)

sleep

public static void sleep(int time)
Sleep without this annoying exception.


isRemote

public static boolean isRemote(java.lang.Object object)
Returns true if the object is a handle to a RMI remote object.


uriToURL

public static java.net.URL uriToURL(java.lang.String uri)
                             throws java.io.IOException
Converts a relative or absolute path or an uri to an absolute URL

Throws:
java.io.IOException

pathParent

public static java.lang.String pathParent(java.lang.String path)
Returns the path which "contains" a path.

Parameters:
path - normalized path

pathLastName

public static java.lang.String pathLastName(java.lang.String path)
Returns the last element of a path.


normalizePath

public static java.lang.String normalizePath(java.lang.String path,
                                             boolean absolute)
Normalizes a path. A backslash is converted to a slash. If 'absolute', return a path with a leading slash.


encodeForURI

public static java.lang.String encodeForURI(java.lang.String uri)

iriToURI

public static java.lang.String iriToURI(java.lang.String uri)

escapeHtmlURI

public static java.lang.String escapeHtmlURI(java.lang.String uri)

countBitsInMask

public static int countBitsInMask(int mask)

dumpBytes

public static void dumpBytes(byte[] bytes,
                             int maxLen)

© 2005 Axyana Software