com.ohrasys.cad.gds
Class GDSStringUtil

java.lang.Object
  extended by com.ohrasys.cad.gds.GDSStringUtil

public class GDSStringUtil
extends java.lang.Object

String utility class.

Since:
1.5

Constructor Summary
GDSStringUtil()
           
 
Method Summary
static boolean consistsOf(java.lang.String data, java.lang.String chars)
          Tests to see if a string consists solely of specified characters.
static java.lang.String fixLength(java.lang.String data, int length)
          Pads a string with blank spaces up to a specified length.
static java.lang.String getSeparator(java.lang.String sep, int len)
          Returns a string consisting of a repeated pattern of the specified separator up to the specified length.
static java.lang.String sprintf(java.lang.String format, java.lang.Object... args)
          A sprintf method implementation.
 java.lang.String toString()
          Returns a string representation of this class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GDSStringUtil

public GDSStringUtil()
Method Detail

consistsOf

public static boolean consistsOf(java.lang.String data,
                                 java.lang.String chars)
Tests to see if a string consists solely of specified characters.

Parameters:
data - The string to test.
chars - A string of valid characters.
Returns:
true if the string is a subset of the specified characters.

fixLength

public static java.lang.String fixLength(java.lang.String data,
                                         int length)
Pads a string with blank spaces up to a specified length.

Parameters:
data - The string to extend.
length - The required length of the string.
Returns:
A new copy of the original string padded with spaces so that it's length is that specified.

getSeparator

public static java.lang.String getSeparator(java.lang.String sep,
                                            int len)
Returns a string consisting of a repeated pattern of the specified separator up to the specified length.

Parameters:
sep - The separator to repeat.
len - The maximum length of the result.
Returns:
A new string of the repeated specified pattern of specified length.

sprintf

public static java.lang.String sprintf(java.lang.String format,
                                       java.lang.Object... args)
A sprintf method implementation.

Parameters:
format - The format control string
args - The format token values
Returns:
The corresponding formatted string

toString

public java.lang.String toString()
Returns a string representation of this class

Overrides:
toString in class java.lang.Object
Returns:
The physical address of this instance