sam.toolkit
Class StringFactory

java.lang.Object
  |
  +--sam.toolkit.StringFactory

public class StringFactory
extends java.lang.Object

This class is a String factory. Its purpose is to build strings of various length composed of the same repeated sequence in an efficient way. Note that all instances of this class should be static as there is no use for having multiple instances of the same factory (which would increase cache size).


Field Summary
static sam.toolkit.StringFactory SPACES
          Factory of blank strings (i.e.
 
Constructor Summary
StringFactory(java.lang.String root)
          Builds a new StringFactory
 
Method Summary
 java.lang.String get(int length)
          Builds the indentation prefix for specified length
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPACES

public static final sam.toolkit.StringFactory SPACES
Factory of blank strings (i.e. composed only of white spaces)

Constructor Detail

StringFactory

public StringFactory(java.lang.String root)
Builds a new StringFactory

Parameters:
root - the root sequence to repeated.
Method Detail

get

public java.lang.String get(int length)
Builds the indentation prefix for specified length