The Octet Molecular Representation Framework v0.8.2

net.sf.octet.util
Class StringKit

java.lang.Object
  extended bynet.sf.octet.util.StringKit

public class StringKit
extends java.lang.Object

A collection of static methods useful for the manipulation of Strings.

Author:
Richard Apodaca

Method Summary
static double extractDouble(java.lang.String string, int start, int stop)
          Returns the double value of the specified substring.
static float extractFloat(java.lang.String string, int start, int stop)
          Returns the float value of the specified substring.
static int extractInt(java.lang.String string, int start, int stop)
          Returns the integer value of the specified substring.
static java.lang.String extractString(java.lang.String string, int start, int stop)
          Returns the specified substring, trimming of whitespace.
static java.lang.String padLeft(java.lang.String string, int length)
          Returns a String to which is prepended enough space (" ") characters to make the total length equal to length.
static java.lang.String padRight(java.lang.String string, int length)
          Returns a String to which is appended enough space (" ") characters to make the total length equal to length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

extractInt

public static int extractInt(java.lang.String string,
                             int start,
                             int stop)
Returns the integer value of the specified substring.

Parameters:
string - the string
start - the start index
stop - the end index
Returns:
the int value

extractFloat

public static float extractFloat(java.lang.String string,
                                 int start,
                                 int stop)
Returns the float value of the specified substring.

Parameters:
string - the string
start - the start index
stop - the end index
Returns:
the float value

extractDouble

public static double extractDouble(java.lang.String string,
                                   int start,
                                   int stop)
Returns the double value of the specified substring.

Parameters:
string - the string
start - the start index
stop - the end index
Returns:
the double value

extractString

public static java.lang.String extractString(java.lang.String string,
                                             int start,
                                             int stop)
Returns the specified substring, trimming of whitespace.

Parameters:
string - the string
start - the start index
stop - the end index
Returns:
the substring

padLeft

public static java.lang.String padLeft(java.lang.String string,
                                       int length)
Returns a String to which is prepended enough space (" ") characters to make the total length equal to length. If the length of string is greater than length, then string is returned with no modifications.

Parameters:
string - a string to operate on
length - the desired final length of the string
Returns:
a string with spaces prepended to it, or just string

padRight

public static java.lang.String padRight(java.lang.String string,
                                        int length)
Returns a String to which is appended enough space (" ") characters to make the total length equal to length. If the length of string is greater than length, then string is returned with no modifications.

Parameters:
string - a string to operate on
length - the desired final length of the string
Returns:
a string with spaces appended to it, or just string

The Octet Molecular Representation Framework v0.8.2