Implicit class that provides a method to wrap a Java iterator into a BetterBufferedIterator.
Implicit class that provides a method to wrap an iterator into a BetterBufferedIterator.
Represents a path to directory.
A trait that combine's scala's Iterator with Java's Iterator.
Represents a path to a file (not a directory) that doesn't have a more specific type.
A String that represents the prefix or basename of a filename.
Implicit class that provides methods for creating Java collections from an Iterator.
Implicit that provides additional methods to any collection that is Parallelizable.
Implicit that provides additional methods to any collection that is Parallelizable. Introduces parWith() methods that create parallel versions of the collection with various configuration options.
the type of the elements in the collection
the type of the parallel representation of the collection
Represents a full path including directories, that is intended to be used as a prefix for generating file paths.
Represents a path to a BAM (or SAM or CRAM) file.
Represents a path to a Reference FASTA file.
Represents a path to a FASTQ file (optionally gzipped).
Represents a path to an intervals file (IntervalList or BED).
Represents a path to a VCF/BCF/VCF.gz.
Implicit class that wraps a closeable and provides a safelyClose method that will not throw any exception.
Implicit that provides additional methods to sum the values of a sequence after applying a mapping to the items.
Implicit that provides additional methods to sum the values of a sequence after applying a mapping to the items. This has the benefit of not creating any intermediate collections or iterators. The mapping must map to a Numeric type.
the type of items to transform.
A more generic for loop, that gives performance similar, but slightly worse than, CommonsDef#forloop(Int,Int,Int).
A more generic for loop, that gives performance similar, but slightly worse than, CommonsDef#forloop(Int,Int,Int). Equivalent to:
for (i=from; check(i); i=next(i)) f(i)
the type of the index
an initial value
a function that checks to see if a value should be evaluated (not cause termination)
a function that takes a value and produced the next value
a function called on all values
An implementation of a for loop that has performance similar to writing a custom while loop for primitive types, which suffer great performance loss when iterating via foreach(), and especially with zipWithIndex.foreach().
An implementation of a for loop that has performance similar to writing a custom while loop for primitive types, which suffer great performance loss when iterating via foreach(), and especially with zipWithIndex.foreach().
Equivalent to: for(int i=from; i<until; i+=by) f(i)
an initial integer values
a value one higher than the last value that should be accepted
a step value to increment by each iteration
a function that takes the index and is called each iteration
Implicit that converts a Java Iterable into a scala Iterator.
Implicit that wraps a Java iterator as a Scala iterator.
Implicit that wraps a Scala iterator as a Java iterator.
Performs the unit of work on a resource of type A cleaning up the resource in the case of an exception or upon completion, and ultimately returning a Try of type B.
Performs the unit of work on a resource of type A cleaning up the resource in the case of an exception or upon completion, and ultimately returning a Try of type B. An exception during cleanup does not change the success of the work. If a logger is provided, the exception is logged, otherwise the exception is ignored.
An example would be:
tryWith(Io.toWriter("/path/does/not/exists")(_.close()) { writer => writer.write("Hello World!")) }
which throws an exception since the path is not found, but this exception is ignored, and a Failure is returned.
the resource type.
the result type of the work performed.
the resource upon which work is performed.
the clean up method to apply to the resource when the work is complete.
the work to perform on the resource, returning a result of type B.
Success if the work was performed successfully, Failure otherwise.
Performs the unit of work on a closeable resource of type A closing up the resource in the case of an exception or upon completion, and ultimately returning a Try.
Performs the unit of work on a closeable resource of type A closing up the resource in the case of an exception or upon completion, and ultimately returning a Try. An exception during closing does not change the success of the work. If a logger is provided, the exception is logged, otherwise the exception is ignored.
An example would be:
tryWith(Io.toWriter("/path/does/not/exists") { writer => writer.write("Hello World!")) }
which throws an exception since the path is not found, but this exception is ignored, and a Failure is returned.
the resource type.
the resource upon which work is performed.
the work to perform on the resource.
Success if the work was performed successfully, Failure otherwise.
A terse way to throw an UnreachableException
that can be used where any type is expected,
e.g.
A terse way to throw an UnreachableException
that can be used where any type is expected,
e.g. Option(thing) getOrElse unreachable("my thing is never null")
an optional message
Construct to capture a value, execute some code, and then returned the captured value.
Construct to capture a value, execute some code, and then returned the captured value. Allows
code like:
val x = foo; foo +=1; return x
to be replaced with
yieldAndThen(foo) {foo +=1}
the type of thing to be returned (usually inferred)
the value to be returned/yielded
a block of code to be evaluated
it
Object that is designed to be imported with
import CommonsDef._
in any/all classes much like the way that scala.PreDef is imported in all files automatically.New methods, types and objects should not be added to this class lightly as they will pollute the namespace of any classes which import it.