pmlib
Class PMLTools

java.lang.Object
  extended by pmlib.PMLTools

public class PMLTools
extends java.lang.Object

PMLTools Class

The PMTools object provides a range of static utility functions.

This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library. If not, see http://www.gnu.org/licenses/.


Constructor Summary
PMLTools()
           
 
Method Summary
static java.lang.String combineStrings(java.lang.String[] s)
          Combine all the strings within the specified array and return the result
static java.lang.String combineStrings(java.lang.String[] sa, java.lang.String ss)
          Combine all the strings within the specified array with the specified spacer string and return the result
static java.lang.String[] readStrings(java.io.File f)
          Converts an input text file to an array of strings
static java.lang.String[] readStrings(java.lang.String f)
          Converts an input text file to an array of strings
static boolean writeStrings(java.lang.String[] sa, java.io.File f)
          Write an array of strings to the specified file
static boolean writeStrings(java.lang.String[] sa, java.lang.String f)
          Write an array of strings to the specified file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PMLTools

public PMLTools()
Method Detail

readStrings

public static java.lang.String[] readStrings(java.lang.String f)
Converts an input text file to an array of strings

If the input file cannot be parsed a null value will be returned.

Parameters:
f - file
Returns:
string array

readStrings

public static java.lang.String[] readStrings(java.io.File f)
Converts an input text file to an array of strings

If the input file cannot be parsed a null value will be returned.

Parameters:
f - file
Returns:
string array

writeStrings

public static boolean writeStrings(java.lang.String[] sa,
                                   java.lang.String f)
Write an array of strings to the specified file

Parameters:
sa - string array
f - output file
Returns:
true if the file was successfully written

writeStrings

public static boolean writeStrings(java.lang.String[] sa,
                                   java.io.File f)
Write an array of strings to the specified file

Parameters:
sa - string array
f - output file
Returns:
true if the file was successfully written

combineStrings

public static java.lang.String combineStrings(java.lang.String[] s)
Combine all the strings within the specified array and return the result

Parameters:
s - array of strings
Returns:
a single combined string

combineStrings

public static java.lang.String combineStrings(java.lang.String[] sa,
                                              java.lang.String ss)
Combine all the strings within the specified array with the specified spacer string and return the result

Parameters:
sa - array of strings
ss - spacer string
Returns:
a single combined string