cascading.util
Class Util

java.lang.Object
  extended by cascading.util.Util

public class Util
extends java.lang.Object

Class Util provides reusable operations.


Nested Class Summary
static interface Util.RetryOperator<T>
           
 
Constructor Summary
Util()
           
 
Method Summary
static java.lang.String captureDebugTrace(java.lang.Class type)
           
static java.lang.String createID(java.lang.String base)
           
static java.lang.Object createProtectedObject(java.lang.Class type, java.lang.Object[] parameters, java.lang.Class[] parameterTypes)
           
static java.lang.String createUniqueID(java.lang.String seed)
          This method creates a globally unique HEX value seeded by the given string.
static java.lang.String findName(java.lang.String path)
           
static java.lang.String findVersion(java.lang.String path)
           
static java.lang.String formatRawTrace(Pipe pipe, java.lang.String message)
          Method formatRawTrace does not include the pipe name
static java.lang.String formatTrace(Operation operation, java.lang.String message)
           
static java.lang.String formatTrace(Pipe pipe, java.lang.String message)
           
static java.lang.String formatTrace(Scheme scheme, java.lang.String message)
           
static java.lang.String formatTrace(Tap tap, java.lang.String message)
           
static java.lang.Object invokeStaticMethod(java.lang.Class type, java.lang.String methodName, java.lang.Object[] parameters, java.lang.Class[] parameterTypes)
           
static boolean isEmpty(java.lang.String string)
           
static java.lang.String join(java.util.Collection collection)
          This method joins each value in the collection with a tab character as the delimiter.
static java.lang.String join(java.util.Collection collection, java.lang.String delim)
          This method joins each valuein the collection with the given delimiter.
static java.lang.String join(java.util.Collection collection, java.lang.String delim, boolean printNull)
           
static java.lang.String join(int[] list, java.lang.String delim)
          This method joins the values in the given list with the delim String value.
static java.lang.String join(int[] list, java.lang.String delim, boolean printNull)
           
static java.lang.String join(java.lang.Object[] list, java.lang.String delim)
          This method joins the values in the given list with the delim String value.
static java.lang.String join(java.lang.Object[] list, java.lang.String delim, boolean printNull)
           
static java.lang.String join(java.lang.Object[] list, java.lang.String delim, boolean printNull, int beginAt)
           
static java.lang.String join(java.lang.Object[] list, java.lang.String delim, boolean printNull, int beginAt, int length)
           
static java.lang.String join(java.lang.String delim, boolean printNull, java.lang.String... strings)
           
static void join(java.lang.StringBuffer buffer, java.util.Collection collection, java.lang.String delim)
          This method joins each value in the collection with the given delimiter.
static void join(java.lang.StringBuffer buffer, java.util.Collection collection, java.lang.String delim, boolean printNull)
           
static java.lang.String join(java.lang.String delim, java.lang.String... strings)
           
static java.lang.String makeTempPath(java.lang.String name)
           
static java.lang.String normalizeUrl(java.lang.String url)
          This method attempts to remove duplicate consecutive forward slashes from the given url.
static java.lang.String print(java.util.Collection collection, java.lang.String delim)
           
static void print(java.lang.StringBuffer buffer, java.util.Collection collection, java.lang.String delim)
           
static void printGraph(java.io.PrintStream out, org.jgrapht.graph.SimpleDirectedGraph graph)
           
static java.lang.String printGraph(org.jgrapht.graph.SimpleDirectedGraph graph)
           
static void printGraph(java.lang.String filename, org.jgrapht.graph.SimpleDirectedGraph graph)
           
static void printMatrix(java.io.PrintStream out, org.jgrapht.graph.SimpleDirectedGraph<FlowElement,Scope> graph)
           
static java.util.Collection<java.lang.String> quote(java.util.Collection<java.lang.String> collection, java.lang.String quote)
           
static void removeAllNulls(java.util.List list)
          This method removes all nulls from the given List.
static java.lang.String[] removeNulls(java.lang.String... strings)
           
static
<T> T
retry(org.slf4j.Logger logger, int retries, int secondsDelay, java.lang.String message, Util.RetryOperator<T> operator)
           
static java.lang.String sanitizeUrl(java.lang.String url)
          This method attempts to remove any username and password from the given url String.
static java.lang.String toNull(java.lang.Object object)
          This method returns the Object.toString() of the given object, or an empty String if the object is null.
static java.lang.String truncate(java.lang.String string, int maxSize)
          This method truncates the given String value to the given size, but appends an ellipse ("...") if the String is larger than maxSize.
static void writeDOT(java.io.Writer writer, org.jgrapht.graph.SimpleDirectedGraph graph, org.jgrapht.ext.IntegerNameProvider vertexIdProvider, org.jgrapht.ext.VertexNameProvider vertexNameProvider, org.jgrapht.ext.EdgeNameProvider edgeNameProvider)
           
 
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

createUniqueID

public static java.lang.String createUniqueID(java.lang.String seed)
This method creates a globally unique HEX value seeded by the given string.

Parameters:
seed -
Returns:
a String

createID

public static java.lang.String createID(java.lang.String base)

join

public static java.lang.String join(int[] list,
                                    java.lang.String delim)
This method joins the values in the given list with the delim String value.

Parameters:
list -
delim -
Returns:
String

join

public static java.lang.String join(int[] list,
                                    java.lang.String delim,
                                    boolean printNull)

join

public static java.lang.String join(java.lang.String delim,
                                    java.lang.String... strings)

join

public static java.lang.String join(java.lang.String delim,
                                    boolean printNull,
                                    java.lang.String... strings)

join

public static java.lang.String join(java.lang.Object[] list,
                                    java.lang.String delim)
This method joins the values in the given list with the delim String value.

Parameters:
list -
delim -
Returns:
a String

join

public static java.lang.String join(java.lang.Object[] list,
                                    java.lang.String delim,
                                    boolean printNull)

join

public static java.lang.String join(java.lang.Object[] list,
                                    java.lang.String delim,
                                    boolean printNull,
                                    int beginAt)

join

public static java.lang.String join(java.lang.Object[] list,
                                    java.lang.String delim,
                                    boolean printNull,
                                    int beginAt,
                                    int length)

join

public static java.lang.String join(java.util.Collection collection)
This method joins each value in the collection with a tab character as the delimiter.

Parameters:
collection -
Returns:
a String

join

public static java.lang.String join(java.util.Collection collection,
                                    java.lang.String delim)
This method joins each valuein the collection with the given delimiter.

Parameters:
collection -
delim -
Returns:
a String

join

public static java.lang.String join(java.util.Collection collection,
                                    java.lang.String delim,
                                    boolean printNull)

join

public static void join(java.lang.StringBuffer buffer,
                        java.util.Collection collection,
                        java.lang.String delim)
This method joins each value in the collection with the given delimiter. All results are appended to the given StringBuffer instance.

Parameters:
buffer -
collection -
delim -

join

public static void join(java.lang.StringBuffer buffer,
                        java.util.Collection collection,
                        java.lang.String delim,
                        boolean printNull)

removeNulls

public static java.lang.String[] removeNulls(java.lang.String... strings)

quote

public static java.util.Collection<java.lang.String> quote(java.util.Collection<java.lang.String> collection,
                                                           java.lang.String quote)

print

public static java.lang.String print(java.util.Collection collection,
                                     java.lang.String delim)

print

public static void print(java.lang.StringBuffer buffer,
                         java.util.Collection collection,
                         java.lang.String delim)

sanitizeUrl

public static java.lang.String sanitizeUrl(java.lang.String url)
This method attempts to remove any username and password from the given url String.

Parameters:
url -
Returns:
a String

normalizeUrl

public static java.lang.String normalizeUrl(java.lang.String url)
This method attempts to remove duplicate consecutive forward slashes from the given url.

Parameters:
url -
Returns:
a String

toNull

public static java.lang.String toNull(java.lang.Object object)
This method returns the Object.toString() of the given object, or an empty String if the object is null.

Parameters:
object -
Returns:
a String

truncate

public static java.lang.String truncate(java.lang.String string,
                                        int maxSize)
This method truncates the given String value to the given size, but appends an ellipse ("...") if the String is larger than maxSize.

Parameters:
string -
maxSize -
Returns:
a String

printGraph

public static java.lang.String printGraph(org.jgrapht.graph.SimpleDirectedGraph graph)

printGraph

public static void printGraph(java.io.PrintStream out,
                              org.jgrapht.graph.SimpleDirectedGraph graph)

printGraph

public static void printGraph(java.lang.String filename,
                              org.jgrapht.graph.SimpleDirectedGraph graph)

printMatrix

public static void printMatrix(java.io.PrintStream out,
                               org.jgrapht.graph.SimpleDirectedGraph<FlowElement,Scope> graph)

removeAllNulls

public static void removeAllNulls(java.util.List list)
This method removes all nulls from the given List.

Parameters:
list -

formatTrace

public static java.lang.String formatTrace(Scheme scheme,
                                           java.lang.String message)

formatRawTrace

public static java.lang.String formatRawTrace(Pipe pipe,
                                              java.lang.String message)
Method formatRawTrace does not include the pipe name

Parameters:
pipe - of type Pipe
message - of type String
Returns:
String

formatTrace

public static java.lang.String formatTrace(Pipe pipe,
                                           java.lang.String message)

formatTrace

public static java.lang.String formatTrace(Tap tap,
                                           java.lang.String message)

formatTrace

public static java.lang.String formatTrace(Operation operation,
                                           java.lang.String message)

captureDebugTrace

public static java.lang.String captureDebugTrace(java.lang.Class type)

writeDOT

public static void writeDOT(java.io.Writer writer,
                            org.jgrapht.graph.SimpleDirectedGraph graph,
                            org.jgrapht.ext.IntegerNameProvider vertexIdProvider,
                            org.jgrapht.ext.VertexNameProvider vertexNameProvider,
                            org.jgrapht.ext.EdgeNameProvider edgeNameProvider)

isEmpty

public static boolean isEmpty(java.lang.String string)

findVersion

public static java.lang.String findVersion(java.lang.String path)

findName

public static java.lang.String findName(java.lang.String path)

retry

public static <T> T retry(org.slf4j.Logger logger,
                          int retries,
                          int secondsDelay,
                          java.lang.String message,
                          Util.RetryOperator<T> operator)
               throws java.lang.Exception
Throws:
java.lang.Exception

createProtectedObject

public static java.lang.Object createProtectedObject(java.lang.Class type,
                                                     java.lang.Object[] parameters,
                                                     java.lang.Class[] parameterTypes)

invokeStaticMethod

public static java.lang.Object invokeStaticMethod(java.lang.Class type,
                                                  java.lang.String methodName,
                                                  java.lang.Object[] parameters,
                                                  java.lang.Class[] parameterTypes)

makeTempPath

public static java.lang.String makeTempPath(java.lang.String name)


Copyright © 2007-2011 Concurrent, Inc. All Rights Reserved.