org.mindswap.utils
Class NewUtils

java.lang.Object
  extended byorg.mindswap.utils.NewUtils

public class NewUtils
extends java.lang.Object

Title:

Description:

Copyright: Copyright (c) 2005

Company: MIndswap (http://www.mindswap.org)

Author:
Michael Grove

Constructor Summary
NewUtils()
           
 
Method Summary
static int[] addToIntArray(int theElem, int[] theIntList)
          Adds an int to an int array.

static java.util.Set collectResourcesFromRDFList(Resource theList)
           
static boolean isInArray(int theElem, int[] theArray)
          Returns true or false depending on whether or not the specified string is in the array.

static java.util.Iterator listClasses(Model theModel)
           
static java.util.Iterator listProperties(Model theModel)
           
static int[] readDelimitedIntegers(java.lang.String theString, java.lang.String theDelims)
          Given a string of delimited integers, return an int array.

static int[] removeFromIntArray(int theElem, int[] theIntList)
          Removes an int to an int array.

static java.lang.String replace(java.lang.String theHost, java.lang.String theOldString, java.lang.String theNewString)
          Given a string, replace all occurances of one string with another.

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NewUtils

public NewUtils()
Method Detail

readDelimitedIntegers

public static int[] readDelimitedIntegers(java.lang.String theString,
                                          java.lang.String theDelims)
                                   throws java.lang.NumberFormatException
Given a string of delimited integers, return an int array.

Returns:
int array whose contents reflect the list of integers in the parameter str
Throws:
java.lang.NumberFormatException - if the string contents elements other than integers in the list

removeFromIntArray

public static int[] removeFromIntArray(int theElem,
                                       int[] theIntList)
Removes an int to an int array.

Returns:
The array with the parameter removed.

addToIntArray

public static int[] addToIntArray(int theElem,
                                  int[] theIntList)
Adds an int to an int array.

Returns:
The array with the parameter added to the end.

isInArray

public static boolean isInArray(int theElem,
                                int[] theArray)
Returns true or false depending on whether or not the specified string is in the array.

Parameters:
theElem - int to search for
theArray - int array to search through
Returns:
true if elem is in array, false otherwise

replace

public static java.lang.String replace(java.lang.String theHost,
                                       java.lang.String theOldString,
                                       java.lang.String theNewString)
Given a string, replace all occurances of one string with another.

Returns:
copy of host with all occurances of param oldchar replaced with param newchar

listClasses

public static java.util.Iterator listClasses(Model theModel)

listProperties

public static java.util.Iterator listProperties(Model theModel)

collectResourcesFromRDFList

public static java.util.Set collectResourcesFromRDFList(Resource theList)