ir.utilities
Class MoreString

java.lang.Object
  extended by ir.utilities.MoreString

public class MoreString
extends java.lang.Object

A place to put some additional string functions


Constructor Summary
MoreString()
           
 
Method Summary
static java.lang.String fileExtension(java.lang.String fileName)
           
static java.lang.String fileToString(java.lang.String fileName)
          Load the stopwords from file to the hashtable where they are indexed.
static int indexOfIgnoreCase(java.lang.String string, java.lang.String substring)
           
static int indexOfIgnoreCase(java.lang.String string, java.lang.String substring, int fromIndex)
           
static void main(java.lang.String[] args)
           
static java.lang.String padTo(java.lang.String string, int length)
          Pad a string with blanks on the right to make it the specified length
static java.lang.String padTo(java.lang.String string, int length, char ch)
          Pad a string with a specific char on the right to make it the specified length
static java.lang.String padToLeft(double x, int length)
          Convert a double to a string and pad with blanks on the left to make it the specified length
static java.lang.String padToLeft(int x, int length)
          Convert an int to a string and pad with blanks on the left to make it the specified length
static java.lang.String padToLeft(java.lang.String string, int length)
          Pad a string with blanks on the left to make it the specified length
static java.lang.String padToLeft(java.lang.String string, int length, char ch)
          Pad a string with a specific char on the left to make it the specified length
static java.lang.String padWithZeros(double x, int length)
           
static java.lang.String padWithZeros(int x, int length)
           
static java.util.ArrayList<java.lang.String> segment(java.lang.String string, char ch)
          Segment a string into substrings by breaking at occurences of the given character and returning a list of segments
static boolean startsWithIgnoreCase(java.lang.String string, java.lang.String substring)
           
static boolean startsWithIgnoreCase(java.lang.String string, java.lang.String substring, int fromIndex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MoreString

public MoreString()
Method Detail

padTo

public static java.lang.String padTo(java.lang.String string,
                                     int length,
                                     char ch)
Pad a string with a specific char on the right to make it the specified length


padTo

public static java.lang.String padTo(java.lang.String string,
                                     int length)
Pad a string with blanks on the right to make it the specified length


padToLeft

public static java.lang.String padToLeft(java.lang.String string,
                                         int length,
                                         char ch)
Pad a string with a specific char on the left to make it the specified length


padToLeft

public static java.lang.String padToLeft(java.lang.String string,
                                         int length)
Pad a string with blanks on the left to make it the specified length


padToLeft

public static java.lang.String padToLeft(double x,
                                         int length)
Convert a double to a string and pad with blanks on the left to make it the specified length


padToLeft

public static java.lang.String padToLeft(int x,
                                         int length)
Convert an int to a string and pad with blanks on the left to make it the specified length


padWithZeros

public static java.lang.String padWithZeros(int x,
                                            int length)

padWithZeros

public static java.lang.String padWithZeros(double x,
                                            int length)

segment

public static java.util.ArrayList<java.lang.String> segment(java.lang.String string,
                                                            char ch)
Segment a string into substrings by breaking at occurences of the given character and returning a list of segments


indexOfIgnoreCase

public static int indexOfIgnoreCase(java.lang.String string,
                                    java.lang.String substring,
                                    int fromIndex)

indexOfIgnoreCase

public static int indexOfIgnoreCase(java.lang.String string,
                                    java.lang.String substring)

startsWithIgnoreCase

public static boolean startsWithIgnoreCase(java.lang.String string,
                                           java.lang.String substring,
                                           int fromIndex)

startsWithIgnoreCase

public static boolean startsWithIgnoreCase(java.lang.String string,
                                           java.lang.String substring)

fileExtension

public static java.lang.String fileExtension(java.lang.String fileName)

fileToString

public static java.lang.String fileToString(java.lang.String fileName)
Load the stopwords from file to the hashtable where they are indexed.


main

public static void main(java.lang.String[] args)