Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.ensembl.util
Class Util

    java.lang.Object
      org.ensembl.util.Util

public class Util
extends java.lang.Object

General utilities that don't fit elsewhere.

Constructor Summary
`Util()`

Method Summary
`static void` | `addToMapList(java.util.Map map, java.lang.Object key, java.lang.Object o)`
`static void` | `addToMapList(cern.colt.map.OpenLongObjectHashMap map, long key, java.lang.Object o)`
`static long[][]` | `batch(long[] input, int maxBatchSize)` Splits input array into "batches" where each batch length is <=maxBatchSize.
`static void` | `dumpTableToFile(java.sql.Connection con, java.lang.String table, java.lang.String fileName)` Dump a table's data to a tab-delimited file.
`static java.lang.String` | `makeEnsemblGeneLink(java.lang.String gene)` Create a link to the ensembl.org page for a particular gene.
`static java.lang.String` | `throwableToStackTraceString(java.lang.Throwable t)`

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

### addToMapList

    public static void addToMapList(java.util.Map map,
                                    java.lang.Object key,
                                    java.lang.Object o)

### addToMapList

    public static void addToMapList(cern.colt.map.OpenLongObjectHashMap map,
                                    long key,
                                    java.lang.Object o)

### dumpTableToFile

    public static void dumpTableToFile(java.sql.Connection con,
                                       java.lang.String table,
                                       java.lang.String fileName)

  Dump a table's data to a tab-delimited file. Null values are written as \N so that they don't get read as strings by LOAD DATA INFILE.

### makeEnsemblGeneLink

    public static java.lang.String makeEnsemblGeneLink(java.lang.String gene)

  Create a link to the ensembl.org page for a particular gene. Species type is currently guessed from gene prefix.

  Parameters:
    `gene` - The gene name.
  Returns:
    A link to the geneview page on ensembl.org, or null if the species can't be deduced.

### batch

    public static long[][] batch(long[] input,
                                 int maxBatchSize)

  Splits input array into "batches" where each batch length is <=maxBatchSize.

  Parameters:
    `maxBatchSize` - maximum batch size, must be >0.
  Returns:
    array of zero or more long arrays.

### throwableToStackTraceString

    public static final java.lang.String throwableToStackTraceString(java.lang.Throwable t)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD