org.annolab.tt4j
Class Util

java.lang.Object
  extended by org.annolab.tt4j.Util

public final class Util
extends Object

Utility functions.

Author:
Richard Eckart de Castilho

Method Summary
static void close(Closeable aClosable)
          Close the given Closeable.
static List<String> getSearchPaths(List<String> aAdditionalPaths, String aSubPath)
          Get the search paths for a model or executable.
static String join(Collection<String> aStrings, String aSeparator)
          Join the given strings into a single string separated by the given separator.
static String join(String[] aStrings, String aSeparator)
          Join the given strings into a single string separated by the given separator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSearchPaths

public static List<String> getSearchPaths(List<String> aAdditionalPaths,
                                          String aSubPath)
Get the search paths for a model or executable. Using the aSubPath argument, executables and models can be searched for in different locations, e.g. executables in executable and models in models.
The returned list contains the additional search paths, the value of the system property treetagger.home and the environment variables TREETAGGER_HOME and TAGDIR in this order.

Parameters:
aAdditionalPaths - additional paths to search in.
aSubPath - search in the given sub-directory of the search paths.
Returns:
a list of search paths.

join

public static String join(String[] aStrings,
                          String aSeparator)
Join the given strings into a single string separated by the given separator.

Parameters:
aStrings - strings to join.
aSeparator - a separator.
Returns:
the joined string.

join

public static String join(Collection<String> aStrings,
                          String aSeparator)
Join the given strings into a single string separated by the given separator.

Parameters:
aStrings - strings to join.
aSeparator - a separator.
Returns:
the joined string.

close

public static void close(Closeable aClosable)
Close the given Closeable.

Parameters:
aClosable - a closable object.


Copyright © 2010. All Rights Reserved.