ipipan.spejd.util
Class Util

java.lang.Object
  extended by ipipan.spejd.util.Util

public class Util
extends java.lang.Object

Utility functions that do not fit in other classes.


Constructor Summary
Util()
           
 
Method Summary
static java.lang.String[] file(java.lang.String filename)
          Loads an array of Strings, every line treated as a separate String.
static java.util.ArrayList<java.lang.String> fileAsList(java.lang.String filename)
          Loads a list of Strings, every line treated as a separate String.
static java.lang.String join(java.lang.String c, java.util.Collection d)
          Similar to join / implode in php.
static int safeParseInt(java.lang.String c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

safeParseInt

public static int safeParseInt(java.lang.String c)

fileAsList

public static java.util.ArrayList<java.lang.String> fileAsList(java.lang.String filename)
Loads a list of Strings, every line treated as a separate String. Empty strings are ignored. Similar to file() in php.

Parameters:
filename - name of the file to load
Returns:
a list of Strings representing the given file's content

file

public static java.lang.String[] file(java.lang.String filename)
Loads an array of Strings, every line treated as a separate String. Empty strings are ignored. Similar to file() in php.

Parameters:
filename - name of the file to load
Returns:
an arrays of Strings representing the given file's content

join

public static java.lang.String join(java.lang.String c,
                                    java.util.Collection d)
Similar to join / implode in php.