o1.util
Members list
Type members
Types
A structural supertype for everything that has a close
method. This is an alias for java.lang.AutoCloseable
.
A structural supertype for everything that has a close
method. This is an alias for java.lang.AutoCloseable
.
Attributes
- See also
An alias for convenient use of scala.util.Try
via import o1.util.*
.
An alias for convenient use of scala.util.Try
via import o1.util.*
.
Attributes
An alias for convenient use of java.nio.file.Path
via import o1.util.*
.
An alias for convenient use of java.nio.file.Path
via import o1.util.*
.
Attributes
An alias for convenient use of scala.util.Random
via import o1.util.*
.
An alias for convenient use of scala.util.Random
via import o1.util.*
.
Attributes
An alias for convenient use of scala.io.Source
via import o1.util.*
.
An alias for convenient use of scala.io.Source
via import o1.util.*
.
Attributes
An alias for convenient use of scala.util.Try
via import o1.util.*
.
An alias for convenient use of scala.util.Try
via import o1.util.*
.
Attributes
An alias for convenient use of scala.util.Try
via import o1.util.*
.
An alias for convenient use of scala.util.Try
via import o1.util.*
.
Attributes
Value members
Concrete methods
Constructs a new Path
object from a given string.
Constructs a new Path
object from a given string.
Attributes
Constructs a new Path
object from a given string URL.
Constructs a new Path
object from a given string URL.
Attributes
A macro that returns a string describing the structure (abstract syntax tree) of the given Scala expression.
A macro that returns a string describing the structure (abstract syntax tree) of the given Scala expression.
Attributes
Searches the working directory and, failing that, the classpath for a readable file or folder with the given relative path. Returns the Path
in an Option
wrapper.
Searches the working directory and, failing that, the classpath for a readable file or folder with the given relative path. Returns the Path
in an Option
wrapper.
Attributes
Calls getLines
on the given Source
and performs the specified effect
on each of the lines. Calls close()
on the source even if an exception occurs, but doesn’t catch any exceptions.
Calls getLines
on the given Source
and performs the specified effect
on each of the lines. Calls close()
on the source even if an exception occurs, but doesn’t catch any exceptions.
Attributes
Performs a given computation and checks to see if it crashes with a NotImplementedError
. Returns the result of the computation in an Option
; returns None
only in the computation wasn’t implemented. Any other exception is thrown.
Performs a given computation and checks to see if it crashes with a NotImplementedError
. Returns the result of the computation in an Option
; returns None
only in the computation wasn’t implemented. Any other exception is thrown.
Type parameters
- Result
-
the type of the given computation
Parameters
- computation
-
a computation that may or may not be implemented
Attributes
Performs a given computation and determines whether it crashes with a NotImplementedError
. Returns true
if it did and false
otherwise.
Performs a given computation and determines whether it crashes with a NotImplementedError
. Returns true
if it did and false
otherwise.
Type parameters
- Result
-
the type of the given computation
Parameters
- computation
-
a computation that may or may not be implemented
Attributes
Searches the classpath for a file with the given relative path and returns the corresponding Path
. The result comes in an Option
wrapper in case no such file is accessible.
Searches the classpath for a file with the given relative path and returns the corresponding Path
. The result comes in an Option
wrapper in case no such file is accessible.
Attributes
Searches the classpath for a file with the given relative path and returns a corresponding Source
. The result comes in an Option
wrapper in case no such file is accessible. Assumes UTF-8 encoding.
Searches the classpath for a file with the given relative path and returns a corresponding Source
. The result comes in an Option
wrapper in case no such file is accessible. Assumes UTF-8 encoding.
Attributes
Searches the classpath for a file with the given relative path. Delegates the task to the class loader. Returns the URL of any found file in an Option
wrapper.
Searches the classpath for a file with the given relative path. Delegates the task to the class loader. Returns the URL of any found file in an Option
wrapper.
Attributes
Reads and returns the lines from a classpath-relative text file. The result comes in an Option
wrapper in case no such file is accessible. Calls close()
on the file even if an exception occurs, but doesn’t catch any exceptions. Assumes UTF-8 encoding.
Reads and returns the lines from a classpath-relative text file. The result comes in an Option
wrapper in case no such file is accessible. Calls close()
on the file even if an exception occurs, but doesn’t catch any exceptions. Assumes UTF-8 encoding.
Parameters
- excludeIfEmpty
-
whether to exclude (possibly trimmed) empty lines from the return value; if unspecified, defaults to
true
- relativePath
-
the path to a resource; relative to a classpath entry
- trimEach
-
whether to remove whitespace around each of the lines; if unspecified, defaults to
true
Attributes
Calls getLines
on the given Source
and returns the lines in a vector. Calls close()
on the source even if an exception occurs, but doesn’t catch any exceptions.
Calls getLines
on the given Source
and returns the lines in a vector. Calls close()
on the source even if an exception occurs, but doesn’t catch any exceptions.
Parameters
- excludeIfEmpty
-
whether to exclude (possibly trimmed) empty lines from the return value; if unspecified, defaults to
true
- source
-
the source to read the lines from
- trimEach
-
whether to remove whitespace around each of the lines; if unspecified, defaults to
true
Attributes
Returns, as a single String
, the entire contents of a classpath-relative text file. The result comes in an Option
wrapper in case no such file is accessible. Calls close()
on the file even if an exception occurs, but doesn’t catch any exceptions. Assumes UTF-8 encoding.
Returns, as a single String
, the entire contents of a classpath-relative text file. The result comes in an Option
wrapper in case no such file is accessible. Calls close()
on the file even if an exception occurs, but doesn’t catch any exceptions. Assumes UTF-8 encoding.
Parameters
- relativePath
-
the path to a resource; relative to a classpath entry
Attributes
A macro that prints out the given expressions. Literals are printed as they are, other expressions as "expr=value"
. Potentially useful for debugging.
A macro that prints out the given expressions. Literals are printed as they are, other expressions as "expr=value"
. Potentially useful for debugging.
Attributes
Takes in a path or a URL as a string and tries to construct a corresponding Source
. Tries to interpret the given string as one of the following, in order:
Takes in a path or a URL as a string and tries to construct a corresponding Source
. Tries to interpret the given string as one of the following, in order:
- A resource relative to the classpath (as per localURL).
- A complete URL string, with protocol and all (e.g., "http://example.com/").
- A URL string with
"http://"
missing (e.g., "example.com"). - A URL string with
"https://"
missing. Callsscala.io.Source.fromURL
on each of those candidates until a source is successfully constructed or all attempts have failed. Assumes UTF-8 encoding.
Parameters
- pathOrURL
-
the possible path or URL to a resource
Attributes
- Returns
-
the first
Success
, or aFailure
if none of the candidates can be read as aSource
Takes in a path or a URL as a string and tries to locate the corresponding resource. Tries to interpret the given string as one of the following (in order until a match is found):
Takes in a path or a URL as a string and tries to locate the corresponding resource. Tries to interpret the given string as one of the following (in order until a match is found):
- A resource relative to the classpath (as per localURL).
- A complete URL string, with protocol and all (e.g., "http://example.com/").
- A URL string with
"http://"
missing (e.g., "example.com").
Parameters
- pathOrURL
-
the possible path or URL to a resource
Attributes
- Returns
-
the first
Success
, or aFailure
if the string isn’t even valid for forming a URL
An alias for convenient access to java.lang.System.getProperty("user.dir")
via import o1.util.*
.
An alias for convenient access to java.lang.System.getProperty("user.dir")
via import o1.util.*
.
Attributes
Writes the given text
in a new text file at the given filePath
. Overwrites any existing file there. Encodes the output as UTF-8. Calls close()
on the output stream even if an exception occurs, but doesn’t catch any exceptions.
Writes the given text
in a new text file at the given filePath
. Overwrites any existing file there. Encodes the output as UTF-8. Calls close()
on the output stream even if an exception occurs, but doesn’t catch any exceptions.
Parameters
- filePath
-
an absolute path to a local file or a path relative to the working directory
Attributes
Concrete fields
A label that can be used as an empty method body or other “no-op” block.
A label that can be used as an empty method body or other “no-op” block.
Attributes
An alias for convenient use of scala.math.Ordering.Double.TotalOrdering
via import o1.util.*
.
An alias for convenient use of scala.math.Ordering.Double.TotalOrdering
via import o1.util.*
.
Attributes
An alias for convenient use of scala.util.Try
via import o1.util.*
.
An alias for convenient use of scala.util.Try
via import o1.util.*
.
Attributes
An alias for convenient use of scala.util.Random
via import o1.util.*
.
An alias for convenient use of scala.util.Random
via import o1.util.*
.
Attributes
An alias for convenient use of scala.io.Source
via import o1.util.*
.
An alias for convenient use of scala.io.Source
via import o1.util.*
.
Attributes
An alias for convenient use of scala.util.Try
via import o1.util.*
.
An alias for convenient use of scala.util.Try
via import o1.util.*
.