org.lsst.ccs.shell.util
Class Strings

java.lang.Object
  extended by org.lsst.ccs.shell.util.Strings

public class Strings
extends Object

Procedural class with static public methods for string handling.

Author:
ASG

Constructor Summary
Strings()
           
 
Method Summary
static String fixCase(String s)
          Fixes case of a word: Str -> str, but URL -> URL.
static String joinStrings(List<String> strings, boolean fixCase, char withChar)
          Generic string joining function.
static List<String> splitJavaIdentifier(String string)
          Rather clever function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Strings

public Strings()
Method Detail

fixCase

public static String fixCase(String s)
Fixes case of a word: Str -> str, but URL -> URL.

Parameters:
s - Word to be fixed
Returns:
all-lowercase or all-uppercase word.

joinStrings

public static String joinStrings(List<String> strings,
                                 boolean fixCase,
                                 char withChar)
Generic string joining function.

Parameters:
strings - Strings to be joined
fixCase - does it need to fix word case
withChar - char to join strings with.
Returns:
joined-string

splitJavaIdentifier

public static List<String> splitJavaIdentifier(String string)
Rather clever function. Splits javaCaseIdentifier into parts (java, Case, Identifier).

Parameters:
string - String to be splitted
Returns:
List of components


Copyright © 2013 LSST. All Rights Reserved.