Java Access to WordNet

danbikel.wordnet
Class Utility

java.lang.Object
  |
  +--danbikel.wordnet.Utility
All Implemented Interfaces:
Serializable

public class Utility
extends Object
implements Serializable

A set of static utility functions. Some of these functions were originally created to provide backward compatibility with the JDK1.1 API.

See Also:
Serialized Form

Method Summary
static HashSet addAll(HashSet hs, Vector v)
          Adds every element in the hash set hs to the vector v.
static Vector addAll(Vector v, Object[] arr)
          Adds every object in arr to the vector v.
static Vector addAll(Vector a, Vector b)
          Adds every element of vector b to vector a (functionally identical to Vector.addAll(Vector) in JDK1.2 jdk 1.1 backward compat fix
static Object getCanonical(Object obj, Map canonical)
          Returns a canonical version of the specified object using the specified reflexive map for canonicalization.
static String join(String[] toks, String delim)
          Returns the string composed of all the tokens in toks with the delimiter delim.
static String join(String[] toks, String delim, int startIdx, int endIdx)
          Returns the string composed of the tokens in toks[startIdx..endIdx] with the delimiter delim.
static String[] split(String s, String delim)
          Tokenizes the string s treating delimiters as tokens.
static String[] split(String s, String delim, boolean delimsAreTokens)
          Returns an array of tokens contained in the string s.
static Object[] toArray(Vector v, Object[] a)
          functionally identical to Vector.toArray() in jdk 1.2 jdk 1.1 backward compat fix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addAll

public static Vector addAll(Vector a,
                            Vector b)
Adds every element of vector b to vector a (functionally identical to Vector.addAll(Vector) in JDK1.2 jdk 1.1 backward compat fix


addAll

public static Vector addAll(Vector v,
                            Object[] arr)
Adds every object in arr to the vector v.


addAll

public static HashSet addAll(HashSet hs,
                             Vector v)
Adds every element in the hash set hs to the vector v.


toArray

public static Object[] toArray(Vector v,
                               Object[] a)
functionally identical to Vector.toArray() in jdk 1.2 jdk 1.1 backward compat fix


split

public static final String[] split(String s,
                                   String delim,
                                   boolean delimsAreTokens)
Returns an array of tokens contained in the string s.

Parameters:
s - the string to tokenize.
delim - the characters to treat as token delimiters.
delimsAreTokens - specifies whether to treat delimiters as tokens.
Returns:
the array of tokens found in s.

split

public static final String[] split(String s,
                                   String delim)
Tokenizes the string s treating delimiters as tokens.

Parameters:
s - the string to tokenize.
delim - the characters to treat as token delimiters.
Returns:
the array of tokens found in s.

join

public static final String join(String[] toks,
                                String delim,
                                int startIdx,
                                int endIdx)
Returns the string composed of the tokens in toks[startIdx..endIdx] with the delimiter delim. Note that toks[endIdx] is included.

Parameters:
toks - the array of tokens to join
delim - the string to insert between each token from toks
startIdx - the first element of toks to include in the join
endIdx - the last element of toks to include in the join

join

public static final String join(String[] toks,
                                String delim)
Returns the string composed of all the tokens in toks with the delimiter delim.


getCanonical

public static Object getCanonical(Object obj,
                                  Map canonical)
Returns a canonical version of the specified object using the specified reflexive map for canonicalization.

Parameters:
canonical - the reflexive map to be used for canonicalization
Returns:
the canonical version of the specified object

Java Access to WordNet

Author: Dan Bikel