jxUtil 0.6

org.sourceforge.jxutil
Class Util

java.lang.Object
  |
  +--org.sourceforge.jxutil.Util

public final class Util
extends Object

Generic utilities. This class groups together a couple of final static methods which can be used anywhere while programming in Java.


Field Summary
static Iterator EMPTY_ITERATOR
           
static Map EMPTY_MAP
           
static Set EMPTY_SET
           
static boolean isUnix
           
static boolean isWin
           
 
Constructor Summary
private Util()
          Cannot instantiate.
 
Method Summary
static int compareTo(Comparable a, Object b)
          Compare two objects allowing null.
static int compareTo(int a, int b)
           
static int compareTo(short a, short b)
           
static Iterator enum2Iterator(Enumeration enum)
          Turn an Enumeration into an Iterator.
static Collection iter2Collection(Collection coll, Enumeration iter)
          Turn an Iterator into a Collection.
static Collection iter2Collection(Enumeration iter)
          Turn an enumeration into a Collection.
static Collection iterator2Collection(Collection coll, Iterator iter)
          Turn an Iterator into a Collection.
static Collection iterator2Collection(Iterator iter)
          Turn an Iterator into a Collection.
static Object keyForValue(Map map, Object value)
           
static void putAll(Dictionary dest, Dictionary src)
          Provides a putAll implementation for Java1.
static String[] split(String src, String delimiter)
          Split a String into a String[] using the StringTokenizer.
static String throwable2String(Throwable ex)
           
static String toBinaryString(int value, int pad)
          Format the integer to a padded binary string.
static String toHexString(int value, int pad)
          Format the integer to a padded hex string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_ITERATOR

public static final Iterator EMPTY_ITERATOR

EMPTY_MAP

public static final Map EMPTY_MAP

EMPTY_SET

public static final Set EMPTY_SET

isUnix

public static final boolean isUnix

isWin

public static final boolean isWin
Constructor Detail

Util

private Util()
Cannot instantiate.

Method Detail

compareTo

public static int compareTo(Comparable a,
                            Object b)
Compare two objects allowing null. Null is ordered low.


compareTo

public static int compareTo(int a,
                            int b)

compareTo

public static int compareTo(short a,
                            short b)

enum2Iterator

public static final Iterator enum2Iterator(Enumeration enum)
Turn an Enumeration into an Iterator.

See Also:
Enumeration, Iterator, Collections.enumeration(Collection)

iter2Collection

public static final Collection iter2Collection(Collection coll,
                                               Enumeration iter)
Turn an Iterator into a Collection.


iter2Collection

public static final Collection iter2Collection(Enumeration iter)
Turn an enumeration into a Collection.


iterator2Collection

public static final Collection iterator2Collection(Collection coll,
                                                   Iterator iter)
Turn an Iterator into a Collection.


iterator2Collection

public static final Collection iterator2Collection(Iterator iter)
Turn an Iterator into a Collection.


keyForValue

public static Object keyForValue(Map map,
                                 Object value)
                          throws NoSuchElementException
NoSuchElementException

putAll

public static void putAll(Dictionary dest,
                          Dictionary src)
Provides a putAll implementation for Java1.


split

public static final String[] split(String src,
                                   String delimiter)
Split a String into a String[] using the StringTokenizer. Works on any type of delimiter, including ''.

See Also:
StringTokenizer

throwable2String

public static String throwable2String(Throwable ex)

toBinaryString

public static final String toBinaryString(int value,
                                          int pad)
Format the integer to a padded binary string.

See Also:
Integer.toHexString(int)

toHexString

public static final String toHexString(int value,
                                       int pad)
Format the integer to a padded hex string.

See Also:
Integer.toHexString(int)

jxUtil 0.6

Copyright © 2001,2002 Keve Müller, et al.; see LICENSE file for details.