NumericString

org.scalactic.anyvals.NumericString
See theNumericString companion object
final class NumericString extends AnyVal

An AnyVal for numeric Strings.

Note: a NumericString contains only numeric digit characters.

Because NumericString is an AnyVal it will usually be as efficient as a String, being boxed only when a String would have been boxed.

The NumericString.apply factory method is implemented in terms of a macro that checks literals for validity at compile time. Calling NumericString.apply with a literal String value will either produce a valid NumericString instance at run time or an error at compile time. Here's an example:

scala> import anyvals._
import anyvals._

scala> NumericString("42")
res0: org.scalactic.anyvals.NumericString = NumericString(42)

scala> NumericString("abc")
<console>:11: error: NumericString.apply can only be invoked on String literals that contain numeric characters, i.e., decimal digits '0' through '9', like "123".
             NumericString("abc")
                          ^

NumericString.apply cannot be used if the value being passed is a variable (i.e., not a literal), because the macro cannot determine the validity of variables at compile time (just literals). If you try to pass a variable to NumericString.apply, you'll get a compiler error that suggests you use a different factory method, NumericString.from, instead:

scala> val x = "1"
x: String = 1

scala> NumericString(x)
<console>:15: error: NumericString.apply can only be invoked on String literals that contain only numeric characters, i.e., decimal digits '0' through '9', like "123" Please use NumericString.from instead.
             NumericString(x)
                          ^

The NumericString.from factory method will inspect the value at runtime and return an Option[NumericString]. If the value is valid, NumericString.from will return a Some[NumericString], else it will return a None. Here's an example:

scala> NumericString.from(x)
res3: Option[org.scalactic.anyvals.NumericString] = Some(NumericString(1))

scala> val y = "a"
y: String = a

scala> NumericString.from(y)
res4: Option[org.scalactic.anyvals.NumericString] = None

Value parameters

value

The String value underlying this NumericString.

Attributes

Companion
object
Source
NumericString.scala
Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Value members

Concrete methods

def *(n: Int): NumericString

Return a NumericString consisting of the current NumericString concatenated n times.

Return a NumericString consisting of the current NumericString concatenated n times.

Attributes

Source
NumericString.scala
def ++(that: String): String

Returns a new String concatenating this NumericString with the passed String.

Returns a new String concatenating this NumericString with the passed String.

Value parameters

that

the String to append

Attributes

Returns

a new String which contains all elements of this NumericString followed by all elements of that

Source
NumericString.scala
def ++:(that: String): String

Returns a new String consisting of this NumericString prepended by the passed String.

Returns a new String consisting of this NumericString prepended by the passed String.

Value parameters

that

the String to append

Attributes

Returns

a new String which contains all elements of that followed by all elements of this NumericString

Source
NumericString.scala
def +:(elem: Char): String

Returns a new String consisting of this NumericString prepended by the passed Char.

Returns a new String consisting of this NumericString prepended by the passed Char.

Value parameters

elem

the prepended Char

Attributes

Returns

a new String consisting of elem followed by all characters from this NumericString

Source
NumericString.scala
def /:(z: Int)(op: (Int, Char) => Int): Int

Applies a binary operator to a start value and all elements of this NumericString, going left to right.

Applies a binary operator to a start value and all elements of this NumericString, going left to right.

Note: /: is alternate syntax for foldLeft; z /: xs is the same as xs foldLeft z.

Value parameters

op

the binary operator

z

the start value

Attributes

Returns

the result of inserting op between consecutive Chars of this NumericString, going left to right with the start value z on the left:

           op(...op(op(z, x_1), x_2), ..., x_n)
     where `x,,1,,, ..., x,,n,,` are the characters of this
     `NumericString`.
Source
NumericString.scala
def :+(elem: Char): String

Returns a new String consisting of this NumericString with the passed Char appended.

Returns a new String consisting of this NumericString with the passed Char appended.

Value parameters

elem

the appended Char

Attributes

Returns

a new String consisting of all elements of this NumericString followed by elem

Source
NumericString.scala
def :\(z: Int)(op: (Char, Int) => Int): Int

Applies a binary operator to all elements of this NumericString and a start value, going right to left.

Applies a binary operator to all elements of this NumericString and a start value, going right to left.

Note: :\ is alternate syntax for foldRight; xs :\ z is the same as xs foldRight z.

Value parameters

op

the binary operator

z

the start value

Attributes

Returns

the result of inserting op between consecutive characters of this NumericString, going right to left with the start value z on the right:

         op(x_1, op(x_2, ... op(x_n, z)...))
   where `x,,1,,, ..., x,,n,,` are the characters of this
   `NumericString`.
Source
NumericString.scala
def <(that: String): Boolean

Returns true if this is less than that

Returns true if this is less than that

Attributes

Source
NumericString.scala
def <=(that: String): Boolean

Returns true if this is less than or equal to that

Returns true if this is less than or equal to that

Attributes

Source
NumericString.scala
def >(that: String): Boolean

Returns true if this is greater than that

Returns true if this is greater than that

Attributes

Source
NumericString.scala
def >=(that: String): Boolean

Returns true if this is greater than or equal to that

Returns true if this is greater than or equal to that

Attributes

Source
NumericString.scala
def addString(b: StringBuilder): StringBuilder

Appends string value of this NumericString to a string builder.

Appends string value of this NumericString to a string builder.

Value parameters

b

the string builder to which this NumericString gets appended

Attributes

Returns

the string builder b to which this NumericString was appended

Source
NumericString.scala
def addString(b: StringBuilder, sep: String): StringBuilder

Appends character elements of this NumericString to a string builder using a separator string.

Appends character elements of this NumericString to a string builder using a separator string.

Value parameters

b

the string builder to which elements are appended

sep

the separator string

Attributes

Returns

the string builder b to which elements were appended

Source
NumericString.scala
def addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder

Appends character elements of this NumericString to a string builder using start, separator, and end strings. The written text begins with the string start and ends with the string end. Inside, the characters of this NumericString are separated by the string sep.

Appends character elements of this NumericString to a string builder using start, separator, and end strings. The written text begins with the string start and ends with the string end. Inside, the characters of this NumericString are separated by the string sep.

Value parameters

b

the string builder to which elements are appended

end

the ending string

sep

the separator string

start

the starting string

Attributes

Returns

the string builder b to which elements were appended

Source
NumericString.scala
def aggregate[B](z: => B)(seqop: (B, Char) => B, combop: (B, B) => B): B

Aggregates the results of applying an operator to subsequent elements of this NumericString.

Aggregates the results of applying an operator to subsequent elements of this NumericString.

This is a more general form of fold and reduce. It is similar to foldLeft in that it doesn't require the result to be a supertype of the element type.

aggregate splits the elements of this NumericString into partitions and processes each partition by sequentially applying seqop, starting with z (like foldLeft). Those intermediate results are then combined by using combop (like fold). The implementation of this operation may operate on an arbitrary number of collection partitions (even 1), so combop may be invoked an arbitrary number of times (even 0).

As an example, consider summing up the integer values the character elements. The initial value for the sum is 0. First, seqop transforms each input character to an Int and adds it to the sum (of the partition). Then, combop just needs to sum up the intermediate results of the partitions:

  NumericString("123").aggregate(0)({ (sum, ch) => sum + ch.toInt }, { (p1, p2) => p1 + p2 })

Value parameters

B

the type of accumulated results

combop

an associative operator used to combine results within a partition

seqop

an operator used to accumulate results within a partition

z

the initial value for the accumulated result of the partition - this will typically be the neutral element for the seqop operator (e.g. Nil for list concatenation or 0 for summation) and may be evaluated more than once

Attributes

Source
NumericString.scala
def apply(index: Int): Char

Return character at index index.

Return character at index index.

Attributes

Returns

the character of this string at index index, where 0 indicates the first element.

Source
NumericString.scala
def canEqual(that: Any): Boolean

Method called from equality methods, so that user-defined subclasses can refuse to be equal to other collections of the same kind.

Method called from equality methods, so that user-defined subclasses can refuse to be equal to other collections of the same kind.

Value parameters

that

the object with which this NumericString should be compared

Attributes

Returns

true if this NumericString can possibly equal that, false otherwise. The test takes into consideration only the run-time types of objects but ignores their elements.

Source
NumericString.scala
def capitalize: String

Returns this string with first character converted to upper case (i.e. unchanged for a NumericString).

Returns this string with first character converted to upper case (i.e. unchanged for a NumericString).

Attributes

Returns

the string value of this NumericString.

Source
NumericString.scala
def charAt(index: Int): Char

Returns the character at the zero-based index within the NumericString.

Returns the character at the zero-based index within the NumericString.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

index

zero-based offset within NumericString

Attributes

Returns

character found at index

Source
NumericString.scala
def codePointAt(index: Int): Int

Returns the integer value of the Unicode code point at the zero-based index within the NumericString.

Returns the integer value of the Unicode code point at the zero-based index within the NumericString.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

index

zero-based offset within NumericString

Attributes

Returns

Unicode code point found at 'index'

Source
NumericString.scala
def codePointCount(beginIndex: Int, endIndex: Int): Int

Returns the count of complete Unicode code points beginning at zero-based beginIndex and ending at (but not including) zero-based endIndex.

Returns the count of complete Unicode code points beginning at zero-based beginIndex and ending at (but not including) zero-based endIndex.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

beginIndex

zero-based starting offset within NumericString

endIndex

zero-based ending offset within NumericString, one-past character range of interest

Attributes

Returns

count of complete Unicode code points found from BeginIndex, up to endIndex

Source
NumericString.scala
def collect[B](pf: PartialFunction[Char, B]): String

Builds a new collection by applying a partial function to all characters of this NumericString on which the function is defined.

Builds a new collection by applying a partial function to all characters of this NumericString on which the function is defined.

Type parameters

B

the element type of the returned collection.

Value parameters

pf

the partial function which filters and maps the elements.

Attributes

Returns

a new String resulting from applying the partial function pf to each element on which it is defined and collecting the results. The order of the elements is preserved.

Source
NumericString.scala
def collectFirst[B](pf: PartialFunction[Char, B]): Option[B]

Finds the first character of the NumericString for which the given partial function is defined, and applies the partial function to it.

Finds the first character of the NumericString for which the given partial function is defined, and applies the partial function to it.

Value parameters

pf

the partial function

Attributes

Returns

an option value containing pf applied to the first value for which it is defined, or None if none exists.

Source
NumericString.scala
def combinations(n: Int): Iterator[String]

Iterates over combinations. A combination of length n is a subsequence of the original sequence, with the elements taken in order. Thus, "xy" and "yy" are both length-2 combinations of "xyy", but "yx" is not. If there is more than one way to generate the same subsequence, only one will be returned.

Iterates over combinations. A combination of length n is a subsequence of the original sequence, with the elements taken in order. Thus, "xy" and "yy" are both length-2 combinations of "xyy", but "yx" is not. If there is more than one way to generate the same subsequence, only one will be returned.

For example, "xyyy" has three different ways to generate "xy" depending on whether the first, second, or third "y" is selected. However, since all are identical, only one will be chosen. Which of the three will be taken is an implementation detail that is not defined.

Attributes

Returns

An Iterator which traverses the possible n-element combinations of this NumericString.

Example

NumericString("12223").combinations(2) = Iterator(12, 13, 22, 23)

Source
NumericString.scala
def compare(that: String): Int

Result of comparing this with operand that.

Result of comparing this with operand that.

Implement this method to determine how instances of A will be sorted.

Returns x where:

  • x < 0 when this < that

  • x == 0 when this == that

  • x > 0 when this > that

Attributes

Source
NumericString.scala
def compareTo(anotherString: String): Int

Compares the NumericString to anotherString, returning an integer <0 if NumericString is less than the supplied string, 0 if identical, and >0 if NumericString is greater than the supplied string.

Compares the NumericString to anotherString, returning an integer <0 if NumericString is less than the supplied string, 0 if identical, and >0 if NumericString is greater than the supplied string.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

anotherString

other string we compare NumericString against

Attributes

Returns

integer <0, 0 or >0 corresponding to lexicographic ordering of NumericString vs. anotherString

Source
NumericString.scala
def concat(str: String): String

Concatenates supplied string str onto the tail end of the NumericString and returns the resulting String.

Concatenates supplied string str onto the tail end of the NumericString and returns the resulting String.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

str

additional string to concatenate onto NumericString

Attributes

Returns

string resulting from the concatenation

Source
NumericString.scala

Returns a new NumericString concatenating this NumericString with the passed NumericString.

Returns a new NumericString concatenating this NumericString with the passed NumericString.

Value parameters

that

the NumericString to append

Attributes

Returns

a new NumericString that concatenates this NumericString with that.

Source
NumericString.scala
def contains(s: CharSequence): Boolean

Tests whether this NumericString contains a given value as an element.

Tests whether this NumericString contains a given value as an element.

Value parameters

s

the element to test.

Attributes

Returns

true if this NumericString has an element that is equal (as determined by ==) to elem, false otherwise.

Source
NumericString.scala
def containsSlice[B](that: Seq[B]): Boolean

Tests whether this NumericString contains a given sequence as a slice.

Tests whether this NumericString contains a given sequence as a slice.

Value parameters

that

the sequence to test

Attributes

Returns

true if this NumericString contains a slice with the same elements as that, otherwise false.

Source
NumericString.scala
def copyToArray(xs: Array[Char], start: Int, len: Int): Unit

Copies the elements of this NumericString to an array. Fills the given array xs with at most len elements of this NumericString, starting at position start. Copying will stop once either the end of the current NumericString is reached, or the end of the target array is reached, or len elements have been copied.

Copies the elements of this NumericString to an array. Fills the given array xs with at most len elements of this NumericString, starting at position start. Copying will stop once either the end of the current NumericString is reached, or the end of the target array is reached, or len elements have been copied.

Value parameters

len

the maximal number of elements to copy.

start

the starting index.

xs

the array to fill.

Attributes

Source
NumericString.scala
def copyToArray(xs: Array[Char]): Unit

Copies the elements of this NumericString to an array. Fills the given array xs with values of this NumericString Copying will stop once either the end of the current NumericString is reached, or the end of the target array is reached.

Copies the elements of this NumericString to an array. Fills the given array xs with values of this NumericString Copying will stop once either the end of the current NumericString is reached, or the end of the target array is reached.

Value parameters

xs

the array to fill.

Attributes

Source
NumericString.scala
def copyToArray(xs: Array[Char], start: Int): Unit

Copies the elements of this NumericString to an array. Fills the given array xs with values of this NumericString, beginning at index start. Copying will stop once either the end of the current NumericString is reached, or the end of the target array is reached.

Copies the elements of this NumericString to an array. Fills the given array xs with values of this NumericString, beginning at index start. Copying will stop once either the end of the current NumericString is reached, or the end of the target array is reached.

Value parameters

start

the starting index.

xs

the array to fill.

Attributes

Source
NumericString.scala
def copyToBuffer[B >: Char](dest: Buffer[B]): Unit

Copies all elements of this NumericString to a buffer.

Copies all elements of this NumericString to a buffer.

Value parameters

dest

The buffer to which elements are copied.

Attributes

Source
NumericString.scala
def corresponds[B](that: Seq[B])(p: (Char, B) => Boolean): Boolean

Tests whether every element of this NumericString relates to the corresponding element of another sequence by satisfying a test predicate.

Tests whether every element of this NumericString relates to the corresponding element of another sequence by satisfying a test predicate.

Type parameters

B

the type of the elements of that

Value parameters

p

the test predicate, which relates elements from both sequences

that

the other sequence

Attributes

Returns

true if both sequences have the same length and p(x, y) is true for all corresponding elements x of this NumericString and y of that, otherwise false.

Source
NumericString.scala
def count(p: Char => Boolean): Int

Counts the number of elements in the NumericString which satisfy a predicate.

Counts the number of elements in the NumericString which satisfy a predicate.

Value parameters

p

the predicate used to test elements.

Attributes

Returns

the number of elements satisfying the predicate p.

Source
NumericString.scala
def diff(that: Seq[Char]): String

Computes the multiset difference between this NumericString and another sequence.

Computes the multiset difference between this NumericString and another sequence.

Value parameters

that

the sequence of elements to remove

Attributes

Returns

a new string which contains all elements of this NumericString except some occurrences of elements that also appear in that. If an element value x appears ''n'' times in that, then the first ''n'' occurrences of x will not form part of the result, but any following occurrences will.

Source
NumericString.scala
def distinct: String

Builds a new NumericString from this NumericString without any duplicate elements.

Builds a new NumericString from this NumericString without any duplicate elements.

Attributes

Returns

A new string which contains the first occurrence of every character of this NumericString.

Source
NumericString.scala
def drop(n: Int): String

Selects all elements except first ''n'' ones.

Selects all elements except first ''n'' ones.

Value parameters

n

the number of elements to drop from this NumericString.

Attributes

Returns

a string consisting of all elements of this NumericString except the first n ones, or else the empty string if this NumericString has less than n elements.

Source
NumericString.scala
def dropRight(n: Int): String

Selects all elements except last ''n'' ones.

Selects all elements except last ''n'' ones.

Value parameters

n

The number of elements to take

Attributes

Returns

a string consisting of all elements of this NumericString except the last n ones, or else the empty string, if this NumericString has less than n elements.

Source
NumericString.scala
def dropWhile(p: Char => Boolean): String

Drops longest prefix of elements that satisfy a predicate.

Drops longest prefix of elements that satisfy a predicate.

Value parameters

p

The predicate used to test elements.

Attributes

Returns

the longest suffix of this NumericString whose first element does not satisfy the predicate p.

Source
NumericString.scala
def endsWith(suffix: String): Boolean

Returns true if the NumericString content completely matches the supplied suffix, when both strings are aligned at their endpoints.

Returns true if the NumericString content completely matches the supplied suffix, when both strings are aligned at their endpoints.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

suffix

string for comparison as a suffix

Attributes

Returns

true if NumericString content completely matches the supplied suffix false otherwise.

Source
NumericString.scala
def endsWith[B](that: Seq[B]): Boolean

Tests whether this NumericString ends with the given sequence.

Tests whether this NumericString ends with the given sequence.

Value parameters

that

the sequence to test

Attributes

Returns

true if this NumericString has that as a suffix, false otherwise.

Source
NumericString.scala
def ensuringValid(f: String => String): NumericString

Applies the passed String => String function to the underlying String value, and if the result is a numeric string, returns the result wrapped in a NumericString, else throws AssertionError.

Applies the passed String => String function to the underlying String value, and if the result is a numeric string, returns the result wrapped in a NumericString, else throws AssertionError.

A factory/assertion method that produces a NumericString given a valid String value, or throws AssertionError, if given an invalid String value.

Note: you should use this method only when you are convinced that it will always succeed, i.e., never throw an exception. It is good practice to add a comment near the invocation of this method indicating ''why'' you think it will always succeed to document your reasoning. If you are not sure an ensuringValid call will always succeed, you should use one of the other factory or validation methods provided on this object instead: isValid, tryingValid, passOrElse, goodOrElse, or rightOrElse.

This method will inspect the result of applying the given function to this NumericString's underlying String value and if the result is a valid numeric string, it will return a NumericString representing that value. Otherwise, the String value returned by the given function is not a valid numeric string, so this method will throw AssertionError.

This method differs from a vanilla assert or ensuring call in that you get something you didn't already have if the assertion succeeds: a type that promises a String contains only numeric digit characters. With this method, you are asserting that you are convinced the result of the computation represented by applying the given function to this NumericString's value will produce a valid numeric string. Instead of producing an invalid NumericString, this method will signal an invalid result with a loud AssertionError.

Value parameters

f

the String => String function to apply to this NumericString's underlying String value.

Attributes

Returns

the result of applying this NumericString's underlying String value to to the passed function, wrapped in a NumericString if it is a valid numeric string (else throws AssertionError).

Throws
AssertionError

if the result of applying this NumericString's underlying String value to to the passed function contains non-digit characters.

Source
NumericString.scala
def equalsIgnoreCase(arg0: String): Boolean

Returns true if the supplied arg0 string is considered equal to this NumericString.

Returns true if the supplied arg0 string is considered equal to this NumericString.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

arg0

string for comparison

Attributes

Returns

true if NumericString content is the same as arg0 false otherwise.

Source
NumericString.scala
def exists(p: Char => Boolean): Boolean

Tests whether a predicate holds for at least one element of this NumericString.

Tests whether a predicate holds for at least one element of this NumericString.

Value parameters

p

the predicate used to test elements.

Attributes

Returns

true if the given predicate p is satisfied by at least one character of this NumericString, otherwise false

Source
NumericString.scala
def filter(p: Char => Boolean): String

Selects all elements of this NumericString which satisfy a predicate.

Selects all elements of this NumericString which satisfy a predicate.

Value parameters

p

the predicate used to test elements.

Attributes

Returns

a string consisting of all characters of this NumericString that satisfy the given predicate p. Their order may not be preserved.

Source
NumericString.scala
def filterNot(p: Char => Boolean): String

Selects all elements of this NumericString which do not satisfy a predicate.

Selects all elements of this NumericString which do not satisfy a predicate.

Value parameters

pred

the predicate used to test elements.

Attributes

Returns

a string consisting of all characters of this NumericString that do not satisfy the given predicate p. Their order may not be preserved.

Source
NumericString.scala
def find(p: Char => Boolean): Option[Char]

Finds the first element of the NumericString satisfying a predicate, if any.

Finds the first element of the NumericString satisfying a predicate, if any.

Value parameters

p

the predicate used to test elements.

Attributes

Returns

an option value containing the first character of the NumericString that satisfies p, or None if none exists.

Source
NumericString.scala
def flatMap[B](f: Char => IterableOnce[B]): IndexedSeq[B]

Builds a new collection by applying a function to all elements of this NumericString and using the elements of the resulting collections.

Builds a new collection by applying a function to all elements of this NumericString and using the elements of the resulting collections.

Type parameters

B

the element type of the returned collection.

Value parameters

f

the function to apply to each element.

Attributes

Returns

a new string resulting from applying the given collection-valued function f to each element of this NumericString and concatenating the results.

Source
NumericString.scala
def fold[A1 >: Char](z: A1)(op: (A1, A1) => A1): A1

Folds the elements of this NumericString using the specified associative binary operator.

Folds the elements of this NumericString using the specified associative binary operator.

Type parameters

A1

a type parameter for the binary operator, a supertype of A.

Value parameters

op

a binary operator that must be associative.

z

a neutral element for the fold operation; may be added to the result an arbitrary number of times, and must not change the result (e.g., Nil for list concatenation, 0 for addition, or 1 for multiplication).

Attributes

Returns

the result of applying the fold operator op between all the elements and z, or z if this NumericString is empty.

Source
NumericString.scala
def foldLeft[B](z: B)(op: (B, Char) => B): B

Applies a binary operator to a start value and all elements of this NumericString, going left to right.

Applies a binary operator to a start value and all elements of this NumericString, going left to right.

Type parameters

B

the result type of the binary operator.

Value parameters

op

the binary operator.

z

the start value.

Attributes

Returns

the result of inserting op between consecutive elements of this NumericString, going left to right with the start value z on the left:

           op(...op(z, x_1), x_2, ..., x_n)
     where `x,,1,,, ..., x,,n,,` are the elements of this
     `NumericString`. Returns `z` if this `NumericString` is empty.
Source
NumericString.scala
def foldRight[B](z: B)(op: (Char, B) => B): B

Applies a binary operator to all elements of this NumericString and a start value, going right to left.

Applies a binary operator to all elements of this NumericString and a start value, going right to left.

Type parameters

B

the result type of the binary operator.

Value parameters

op

the binary operator.

z

the start value.

Attributes

Returns

the result of inserting op between consecutive elements of this NumericString, going right to left with the start value z on the right:

           op(x_1, op(x_2, ... op(x_n, z)...))
     where `x,,1,,, ..., x,,n,,` are the elements of
     this `NumericString`.  Returns `z` if this
     `NumericString` is empty.
Source
NumericString.scala
def forall(p: Char => Boolean): Boolean

Tests whether a predicate holds for all elements of this NumericString.

Tests whether a predicate holds for all elements of this NumericString.

Value parameters

p

the predicate used to test elements.

Attributes

Returns

true if this NumericString is empty or the given predicate p holds for all elements of this NumericString, otherwise false.

Source
NumericString.scala
def foreach(f: Char => Unit): Unit

Applies a function f to all elements of this NumericString.

Applies a function f to all elements of this NumericString.

Value parameters

f

the function that is applied for its side-effect to every element. The result of function f is discarded.

Attributes

Source
NumericString.scala
def getBytes: Array[Byte]

Returns an array of bytes corresponding to the NumericString characters, interpreted via the platform's default Charset-mapping of Unicode code points.

Returns an array of bytes corresponding to the NumericString characters, interpreted via the platform's default Charset-mapping of Unicode code points.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Attributes

Returns

array of bytes corresponding to NumericString characters

Source
NumericString.scala
def getBytes(charset: Charset): Array[Byte]

Returns an array of bytes corresponding to the NumericString characters, interpreted via the supplied charset mapping of Unicode code points.

Returns an array of bytes corresponding to the NumericString characters, interpreted via the supplied charset mapping of Unicode code points.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

charset

a mapping of Unicode code points to bytes

Attributes

Returns

array of bytes corresponding to NumericString characters

Source
NumericString.scala
def getBytes(charsetName: String): Array[Byte]

Returns an array of bytes corresponding to the NumericString characters, interpreted via the named charsetName Charset-mapping of Unicode code points.

Returns an array of bytes corresponding to the NumericString characters, interpreted via the named charsetName Charset-mapping of Unicode code points.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

charsetName

string that names an already-known mapping of Unicode code points to bytes

Attributes

Returns

array of bytes corresponding to NumericString characters

Source
NumericString.scala
def getChars(srcBegin: Int, srcEnd: Int, dst: Array[Char], dstBegin: Int): Unit

Extracts the range of NumericString characters beginning at zero-based srcBegin through but not including srcEnd, into the supplied character array dst, writing the characters at the zero-based dstBegin index forward within that array.

Extracts the range of NumericString characters beginning at zero-based srcBegin through but not including srcEnd, into the supplied character array dst, writing the characters at the zero-based dstBegin index forward within that array.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

dst

supplied character array to write extracted characters into

dstBegin

zero-based index within destination array at which to begin writing

srcBegin

zero-based index where to begin extracting characters from NumericString

srcEnd

zero-based limit before which to stop extracting characters from NumericString

Attributes

Returns

Unit -- this function modifies the supplied dst array

Source
NumericString.scala
def groupBy[K](f: Char => K): Map[K, String]

Partitions this NumericString into a map of strings according to some discriminator function.

Partitions this NumericString into a map of strings according to some discriminator function.

Type parameters

K

the type of keys returned by the discriminator function.

Value parameters

f

the discriminator function.

Attributes

Returns

A map from keys to strings such that the following invariant holds:

               (xs groupBy f)(k) = xs filter (x => f(x) == k)
         That is, every key `k` is bound to a string of those
         elements `x` for which `f(x)` equals `k`.
Source
NumericString.scala
def grouped(size: Int): Iterator[String]

Partitions elements in fixed size strings.

Partitions elements in fixed size strings.

Value parameters

size

the number of elements per group

Attributes

Returns

An iterator producing strings of size size, except the last will be less than size size if the elements don't divide evenly.

See also

scala.collection.Iterator, method grouped

Source
NumericString.scala
def hasDefiniteSize: Boolean

Tests whether this NumericString is known to have a finite size. Always true for NumericString.

Tests whether this NumericString is known to have a finite size. Always true for NumericString.

Attributes

Returns

true if this collection is known to have finite size, false otherwise.

Source
NumericString.scala
def head: Char

Selects the first element of this NumericString.

Selects the first element of this NumericString.

Attributes

Returns

the first element of this NumericString.

Throws
NoSuchElementException

if the NumericString is empty.

Source
NumericString.scala
def headOption: Option[Char]

Optionally selects the first element.

Optionally selects the first element.

Attributes

Returns

the first element of this NumericString if it is nonempty, None if it is empty.

Source
NumericString.scala
def indexOf(ch: Int): Int

Returns zero-based index in Unicode code units (logical index of characters) of first-encountered NumericString character matching the supplied Unicode ch; returns -1 if no matching character is found.

Returns zero-based index in Unicode code units (logical index of characters) of first-encountered NumericString character matching the supplied Unicode ch; returns -1 if no matching character is found.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

ch

Unicode character to look for

Attributes

Returns

zero-based integer index in Unicode code units of first-encountered instance of ch

Source
NumericString.scala
def indexOf(ch: Int, fromIndex: Int): Int

Returns zero-based index (in Unicode code units: logical index of characters) of first-encountered NumericString character matching supplied Unicode ch, beginning search at zero-based index fromIndex; returns -1 if no matching character is found or if fromIndex is outside the bounds of NumericString.

Returns zero-based index (in Unicode code units: logical index of characters) of first-encountered NumericString character matching supplied Unicode ch, beginning search at zero-based index fromIndex; returns -1 if no matching character is found or if fromIndex is outside the bounds of NumericString.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

ch

Unicode character to look for

fromIndex

zero-based integer index at which to begin search for match of ch character

Attributes

Returns

zero-based integer index in Unicode code units of first-encountered instance of ch at/beyond fromIndex

Source
NumericString.scala
def indexOf(str: String): Int

Returns zero-based index (in Unicode code units: logical index of characters) of starting-character position of first-encountered match of str within NumericString; returns -1 if no fully-matching substring is found.

Returns zero-based index (in Unicode code units: logical index of characters) of starting-character position of first-encountered match of str within NumericString; returns -1 if no fully-matching substring is found.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

str

Unicode string to look for

Attributes

Returns

zero-based integer index in Unicode code units, of starting position of first-encountered instance of str in NumericString

Source
NumericString.scala
def indexOf(str: String, fromIndex: Int): Int

Returns zero-based index (in Unicode code units: logical index of characters) of starting-character position of first-encountered match of str within NumericString, beginning search at zero-based index fromIndex; returns -1 if no fully-matching substring is found, or if fromIndex is outside the bounds of NumericString.

Returns zero-based index (in Unicode code units: logical index of characters) of starting-character position of first-encountered match of str within NumericString, beginning search at zero-based index fromIndex; returns -1 if no fully-matching substring is found, or if fromIndex is outside the bounds of NumericString.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

fromIndex

zero-based integer index at which to begin search for match of str string

str

Unicode string to look for

Attributes

Returns

zero-based integer index in Unicode code units, of starting position of first-encountered instance of str in NumericString at/beyond fromIndex

Source
NumericString.scala
def indexOfSlice[B >: Char](that: Seq[B], from: Int): Int

Finds first index after or at a start index where this NumericString contains a given sequence as a slice.

Finds first index after or at a start index where this NumericString contains a given sequence as a slice.

Value parameters

from

the start index

that

the sequence to test

Attributes

Returns

the first index >= from such that the elements of this NumericString starting at this index match the elements of sequence that, or -1 of no such subsequence exists.

Source
NumericString.scala
def indexOfSlice[B >: Char](that: Seq[B]): Int

Finds first index where this NumericString contains a given sequence as a slice.

Finds first index where this NumericString contains a given sequence as a slice.

Value parameters

that

the sequence to test

Attributes

Returns

the first index such that the elements of this NumericString starting at this index match the elements of sequence that, or -1 of no such subsequence exists.

Source
NumericString.scala
def indexWhere(p: Char => Boolean, from: Int): Int

Finds index of the first element satisfying some predicate after or at some start index.

Finds index of the first element satisfying some predicate after or at some start index.

Value parameters

from

the start index

p

the predicate used to test elements.

Attributes

Returns

the index >= from of the first element of this NumericString that satisfies the predicate p, or -1, if none exists.

Source
NumericString.scala
def indexWhere(p: Char => Boolean): Int

Finds index of first element satisfying some predicate.

Finds index of first element satisfying some predicate.

Value parameters

p

the predicate used to test elements.

Attributes

Returns

the index of the first element of this NumericString that satisfies the predicate p, or -1, if none exists.

Source
NumericString.scala
def indices: Range

Produces the range of all indices of this sequence.

Produces the range of all indices of this sequence.

Attributes

Returns

a Range value from 0 to one less than the length of this NumericString.

Source
NumericString.scala
def init: String

Selects all elements except the last.

Selects all elements except the last.

Attributes

Returns

a string consisting of all elements of this NumericString except the last one.

Throws
UnsupportedOperationException

if the NumericString is empty.

Source
NumericString.scala
def inits: Iterator[String]

Iterates over the inits of this NumericString. The first value will be the string for this NumericString and the final one will be an empty string, with the intervening values the results of successive applications of init.

Iterates over the inits of this NumericString. The first value will be the string for this NumericString and the final one will be an empty string, with the intervening values the results of successive applications of init.

Attributes

Returns

an iterator over all the inits of this NumericString

Example

NumericString("123").inits = Iterator(123, 12, 1, "")

Source
NumericString.scala
def intern: String

Add this immutable NumericString's String value to the pool of interned strings, so there is only one copy of the string's representation in memory, shared among all instances.

Add this immutable NumericString's String value to the pool of interned strings, so there is only one copy of the string's representation in memory, shared among all instances.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Attributes

Returns

String which is now in the pool of interned strings

Source
NumericString.scala
def intersect(that: Seq[Char]): String

Computes the multiset intersection between this NumericString and another sequence.

Computes the multiset intersection between this NumericString and another sequence.

Value parameters

that

the sequence of elements to intersect with.

Attributes

Returns

a new string which contains all elements of this NumericString which also appear in that. If an element value x appears ''n'' times in that, then the first ''n'' occurrences of x will be retained in the result, but any following occurrences will be omitted.

Source
NumericString.scala
def isDefinedAt(idx: Int): Boolean

Tests whether this NumericString contains given index.

Tests whether this NumericString contains given index.

Value parameters

idx

the index to test

Attributes

Returns

true if this NumericString contains an element at position idx, false otherwise.

Source
NumericString.scala
def isEmpty: Boolean

Returns true if NumericString contains no characters (not even whitespace); otherwise returns false.

Returns true if NumericString contains no characters (not even whitespace); otherwise returns false.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Attributes

Returns

true if NumericString contains no characters (not even whitespace) false otherwise.

Source
NumericString.scala
final def isTraversableAgain: Boolean

Tests whether this NumericString can be repeatedly traversed. Always true for NumericString.

Tests whether this NumericString can be repeatedly traversed. Always true for NumericString.

Attributes

Returns

true if it is repeatedly traversable, false otherwise.

Source
NumericString.scala
def iterator: Iterator[Char]

Creates a new iterator over all elements contained in this iterable object.

Creates a new iterator over all elements contained in this iterable object.

Attributes

Returns

the new iterator

Source
NumericString.scala
def last: Char

Selects the last element.

Selects the last element.

Attributes

Returns

The last element of this NumericString.

Throws
NoSuchElementException

If the NumericString is empty.

Source
NumericString.scala
def lastIndexOf(ch: Int): Int

Returns zero-based index of the final occurrence of the Unicode character ch in the NumericString.

Returns zero-based index of the final occurrence of the Unicode character ch in the NumericString.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

ch

Unicode character for which to search backwards

Attributes

Returns

zero-based integer index of the final occurrence of this character in NumericString; -1 if not found

Source
NumericString.scala
def lastIndexOf(ch: Int, fromIndex: Int): Int

Returns zero-based index of the final occurrence of the Unicode character ch in the NumericString, with search beginning at zero-based fromIndex and proceeding backwards.

Returns zero-based index of the final occurrence of the Unicode character ch in the NumericString, with search beginning at zero-based fromIndex and proceeding backwards.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

ch

Unicode character for which to search backwards

fromIndex

zero-based index of starting position

Attributes

Returns

zero-based index of the final (rightmost) occurrence of this character in NumericString; -1 if not found

Source
NumericString.scala
def lastIndexOf(str: String): Int

Returns zero-based index from the beginning of NumericString of the first character position for where the string str fully matched rightmost within NumericString.

Returns zero-based index from the beginning of NumericString of the first character position for where the string str fully matched rightmost within NumericString.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

str

string for comparison

Attributes

Returns

zero-based integer index of first character position of where str fully matched rightmost within NumericString; -1 if not found

Source
NumericString.scala
def lastIndexOf(str: String, fromIndex: Int): Int

Returns zero-based index from the beginning of NumericString of the first character position for where the string str fully matched rightmost within NumericString, with search beginning at zero-based fromIndex and proceeding backwards.

Returns zero-based index from the beginning of NumericString of the first character position for where the string str fully matched rightmost within NumericString, with search beginning at zero-based fromIndex and proceeding backwards.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

fromIndex

zero-based index of starting position

str

string for comparison

Attributes

Returns

zero-based integer index of first character position of where str fully matched rightmost within NumericString; -1 if not found

Source
NumericString.scala
def lastIndexOfSlice[B >: Char](that: Seq[B], end: Int): Int

Finds last index before or at a given end index where this NumericString contains a given sequence as a slice.

Finds last index before or at a given end index where this NumericString contains a given sequence as a slice.

Value parameters

end

the end index

that

the sequence to test

Attributes

Returns

the last index <= end such that the elements of this NumericString starting at this index match the elements of sequence that, or -1 of no such subsequence exists.

Source
NumericString.scala
def lastIndexOfSlice[B >: Char](that: Seq[B]): Int

Finds last index where this NumericString contains a given sequence as a slice.

Finds last index where this NumericString contains a given sequence as a slice.

Value parameters

that

the sequence to test

Attributes

Returns

the last index such that the elements of this NumericString starting a this index match the elements of sequence that, or -1 of no such subsequence exists.

Source
NumericString.scala
def lastIndexWhere(p: Char => Boolean, end: Int): Int

Finds index of last element satisfying some predicate before or at given end index.

Finds index of last element satisfying some predicate before or at given end index.

Value parameters

p

the predicate used to test elements.

Attributes

Returns

the index <= end of the last element of this NumericString that satisfies the predicate p, or -1, if none exists.

Source
NumericString.scala
def lastIndexWhere(p: Char => Boolean): Int

Finds index of last element satisfying some predicate.

Finds index of last element satisfying some predicate.

Value parameters

p

the predicate used to test elements.

Attributes

Returns

the index of the last element of this NumericString that satisfies the predicate p, or -1, if none exists.

Source
NumericString.scala
def lastOption: Option[Char]

Optionally selects the last element.

Optionally selects the last element.

Attributes

Returns

the last element of this NumericString if it is nonempty, None if it is empty.

Source
NumericString.scala
def length: Int

Returns length of this NumericString in Unicode characters.

Returns length of this NumericString in Unicode characters.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Attributes

Returns

length of this NumericString

Source
NumericString.scala
def lengthCompare(len: Int): Int

Compares the length of this NumericString to a test value.

Compares the length of this NumericString to a test value.

Value parameters

len

the test value that gets compared with the length.

Attributes

Returns

A value x where

      x <  0       if this.length <  len
      x == 0       if this.length == len
      x >  0       if this.length >  len

The method as implemented here does not call length directly; its running time is O(length min len) instead of O(length). The method should be overwritten if computing length is cheap.

Source
NumericString.scala
def lines: Iterator[String]

Return all lines in this NumericString in an iterator. Always returns a single string for NumericString.

Return all lines in this NumericString in an iterator. Always returns a single string for NumericString.

Attributes

Source
NumericString.scala
def linesWithSeparators: Iterator[String]

Return all lines in this NumericString in an iterator, including trailing line end characters. Always returns a single string with no endline, for NumericString.

Return all lines in this NumericString in an iterator, including trailing line end characters. Always returns a single string with no endline, for NumericString.

Attributes

Source
NumericString.scala
def map(f: Char => Char): String

Builds a new string by applying a function to all elements of this NumericString.

Builds a new string by applying a function to all elements of this NumericString.

Value parameters

f

the function to apply to each element.

Attributes

Returns

a new string resulting from applying the given function f to each character of this NumericString and collecting the results.

Source
NumericString.scala
def matches(regex: String): Boolean

Returns true if the this NumericString's String value matches the supplied regular expression, regex; otherwise returns false.

Returns true if the this NumericString's String value matches the supplied regular expression, regex; otherwise returns false.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

regex

regular-expression string

Attributes

Returns

true if NumericString content matches supplied regular expression regex; false otherwise.

Source
NumericString.scala
def max: Char

Finds the largest element.

Finds the largest element.

Attributes

Returns

the largest character of this NumericString.

Source
NumericString.scala
def maxBy[B](f: Char => B)(implicit cmp: Ordering[B]): Char

Finds the first element which yields the largest value measured by function f.

Finds the first element which yields the largest value measured by function f.

Type parameters

B

The result type of the function f.

Value parameters

cmp

An ordering to be used for comparing elements.

f

The measuring function.

Attributes

Returns

the first element of this NumericString with the largest value measured by function f with respect to the ordering cmp.

Source
NumericString.scala
def min: Char

Finds the smallest element.

Finds the smallest element.

Attributes

Returns

the smallest element of this NumericString.

Source
NumericString.scala
def minBy[B](f: Char => B)(implicit cmp: Ordering[B]): Char

Finds the first element which yields the smallest value measured by function f.

Finds the first element which yields the smallest value measured by function f.

Type parameters

B

The result type of the function f.

Value parameters

cmp

An ordering to be used for comparing elements.

f

The measuring function.

Attributes

Returns

the first element of this NumericString with the smallest value measured by function f with respect to the ordering cmp.

Source
NumericString.scala
def mkString: String

Displays all elements of this NumericString in a string.

Displays all elements of this NumericString in a string.

Attributes

Returns

a string representation of this NumericString. In the resulting string the string representations (w.r.t. the method toString) of all elements of this NumericString follow each other without any separator string.

Source
NumericString.scala
def mkString(sep: String): String

Displays all elements of this NumericString in a string using a separator string.

Displays all elements of this NumericString in a string using a separator string.

Value parameters

sep

the separator string.

Attributes

Returns

a string representation of this NumericString. In the resulting string the string representations (w.r.t. the method toString) of all elements of this NumericString are separated by the string sep.

Example

NumericString("123").mkString("|") = "1|2|3"

Source
NumericString.scala
def mkString(start: String, sep: String, end: String): String

Displays all elements of this NumericString in a string using start, end, and separator strings.

Displays all elements of this NumericString in a string using start, end, and separator strings.

Value parameters

end

the ending string.

sep

the separator string.

start

the starting string.

Attributes

Returns

a string representation of this NumericString. The resulting string begins with the string start and ends with the string end. Inside, the string representations (w.r.t. the method toString) of all elements of this NumericString are separated by the string sep.

Example

NumericString("123").mkString("(", "; ", ")") = "(1; 2; 3)"

Source
NumericString.scala
def nonEmpty: Boolean

Tests whether the NumericString is not empty.

Tests whether the NumericString is not empty.

Attributes

Returns

true if the NumericString contains at least one element, false otherwise.

Source
NumericString.scala
def padTo(len: Int, elem: Char): String

A string copy of this NumericString with an element value appended until a given target length is reached.

A string copy of this NumericString with an element value appended until a given target length is reached.

Value parameters

elem

the padding value

len

the target length

Attributes

Returns

a new string consisting of all elements of this NumericString followed by the minimal number of occurrences of elem so that the resulting string has a length of at least len.

Source
NumericString.scala
def partition(p: Char => Boolean): (String, String)

Partitions this NumericString in two strings according to a predicate.

Partitions this NumericString in two strings according to a predicate.

Value parameters

pred

the predicate on which to partition.

Attributes

Returns

a pair of strings -- the first string consists of all elements that satisfy the predicate p and the second string consists of all elements that don't. The relative order of the elements in the resulting strings may not be preserved.

Source
NumericString.scala
def patch(from: Int, that: Seq[Char], replaced: Int): String

Produces a new string where a slice of elements in this NumericString is replaced by another sequence.

Produces a new string where a slice of elements in this NumericString is replaced by another sequence.

Value parameters

from

the index of the first replaced element

patch

the replacement sequence

replaced

the number of elements to drop in the original NumericString

Attributes

Returns

a new string consisting of all elements of this NumericString except that replaced elements starting from from are replaced by patch.

Source
NumericString.scala
def permutations: Iterator[String]

Iterates over distinct permutations.

Iterates over distinct permutations.

Attributes

Returns

An Iterator which traverses the distinct permutations of this NumericString.

Example

NumericString("122").permutations = Iterator(122, 212, 221)

Source
NumericString.scala
def prefixLength(p: Char => Boolean): Int

Returns the length of the longest prefix whose elements all satisfy some predicate.

Returns the length of the longest prefix whose elements all satisfy some predicate.

Value parameters

p

the predicate used to test elements.

Attributes

Returns

the length of the longest prefix of this NumericString such that every element of the segment satisfies the predicate p.

Source
NumericString.scala
def product[B >: Char](implicit num: Numeric[B]): B

Multiplies up the elements of this collection.

Multiplies up the elements of this collection.

Type parameters

B

the result type of the * operator.

Value parameters

num

an implicit parameter defining a set of numeric operations which includes the * operator to be used in forming the product.

Attributes

Returns

the product of all elements of this NumericString with respect to the * operator in num.

Source
NumericString.scala
def r(groupNames: String*): Regex

You can follow a NumericString with .r(g1, ... , gn), turning it into a Regex, with group names g1 through gn.

You can follow a NumericString with .r(g1, ... , gn), turning it into a Regex, with group names g1 through gn.

This is not particularly useful for a NumericString, given the limitations on its content.

Value parameters

groupNames

The names of the groups in the pattern, in the order they appear.

Attributes

Source
NumericString.scala
def r: Regex

You can follow a NumericString with .r, turning it into a Regex.

You can follow a NumericString with .r, turning it into a Regex.

This is not particularly useful for a NumericString, given the limitations on its content.

Attributes

Source
NumericString.scala
def reduce[A1 >: Char](op: (A1, A1) => A1): A1

Reduces the elements of this NumericString using the specified associative binary operator.

Reduces the elements of this NumericString using the specified associative binary operator.

Type parameters

A1

A type parameter for the binary operator, a supertype of A.

Value parameters

op

A binary operator that must be associative.

Attributes

Returns

The result of applying reduce operator op between all the elements if the NumericString is nonempty.

Throws
UnsupportedOperationException

if this NumericString is empty.

Source
NumericString.scala
def reduceLeft[B >: Char](op: (B, Char) => B): B

Applies a binary operator to all elements of this NumericString, going left to right.

Applies a binary operator to all elements of this NumericString, going left to right.

Type parameters

B

the result type of the binary operator.

Value parameters

op

the binary operator.

Attributes

Returns

the result of inserting op between consecutive elements of this NumericString, going left to right:

           op( op( ... op(x_1, x_2) ..., x_{n-1}), x_n)
     where `x,,1,,, ..., x,,n,,` are the elements of
     this `NumericString`.
Throws
UnsupportedOperationException

if this NumericString is empty.

Source
NumericString.scala
def reduceLeftOption[B >: Char](op: (B, Char) => B): Option[B]

Optionally applies a binary operator to all elements of this NumericString, going left to right.

Optionally applies a binary operator to all elements of this NumericString, going left to right.

Type parameters

B

the result type of the binary operator.

Value parameters

op

the binary operator.

Attributes

Returns

an option value containing the result of reduceLeft(op) if this NumericString is nonempty, None otherwise.

Source
NumericString.scala
def reduceOption[A1 >: Char](op: (A1, A1) => A1): Option[A1]

Reduces the elements of this NumericString, if any, using the specified associative binary operator.

Reduces the elements of this NumericString, if any, using the specified associative binary operator.

Type parameters

A1

A type parameter for the binary operator, a supertype of A.

Value parameters

op

A binary operator that must be associative.

Attributes

Returns

An option value containing result of applying reduce operator op between all the elements if the collection is nonempty, and None otherwise.

Source
NumericString.scala
def reduceRight[B >: Char](op: (Char, B) => B): B

Applies a binary operator to all elements of this NumericString, going right to left.

Applies a binary operator to all elements of this NumericString, going right to left.

Type parameters

B

the result type of the binary operator.

Value parameters

op

the binary operator.

Attributes

Returns

the result of inserting op between consecutive elements of this NumericString, going right to left:

           op(x_1, op(x_2, ..., op(x_{n-1}, x_n)...))
     where `x,,1,,, ..., x,,n,,` are the elements of
     this `NumericString`.
Throws
UnsupportedOperationException

if this NumericString is empty.

Source
NumericString.scala
def reduceRightOption[B >: Char](op: (Char, B) => B): Option[B]

Optionally applies a binary operator to all elements of this NumericString, going right to left.

Optionally applies a binary operator to all elements of this NumericString, going right to left.

Type parameters

B

the result type of the binary operator.

Value parameters

op

the binary operator.

Attributes

Returns

an option value containing the result of reduceRight(op) if this NumericString is nonempty, None otherwise.

Source
NumericString.scala
def regionMatches(ignoreCase: Boolean, toffset: Int, other: String, ooffset: Int, len: Int): Boolean

Returns true if the given region of text matches completely for the len characters beginning at toffset in the NumericString text and at ooffset in the supplied other string text, with the option to ignoreCase during matching; otherwise returns false.

Returns true if the given region of text matches completely for the len characters beginning at toffset in the NumericString text and at ooffset in the supplied other string text, with the option to ignoreCase during matching; otherwise returns false.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

ignoreCase

if nonzero, comparison ignores case

len

length of comparison, in characters

ooffset

zero-based offset of start point of comparison in other string text

other

string supplied for comparison

toffset

zero-based offset of start point of comparison in NumericString text

Attributes

Returns

true if region of text matches completely for given length; false otherwise.

Source
NumericString.scala
def regionMatches(toffset: Int, other: String, ooffset: Int, len: Int): Boolean

Returns true if the given region of text matches completely for the len characters beginning at toffset in the NumericString text and at ooffset in the supplied other string text; otherwise returns false.

Returns true if the given region of text matches completely for the len characters beginning at toffset in the NumericString text and at ooffset in the supplied other string text; otherwise returns false.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

len

length of comparison, in characters

ooffset

zero-based offset of start point of comparison in other string text

other

string supplied for comparison

toffset

zero-based offset of start point of comparison in NumericString text

Attributes

Returns

true if region of text matches completely for given length; false otherwise.

Source
NumericString.scala
def replace(oldChar: Char, newChar: Char): String

Returns the new String resulting from replacing all occurrences of oldChar with newChar.

Returns the new String resulting from replacing all occurrences of oldChar with newChar.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

newChar

character that will take its place

oldChar

character to replace

Attributes

Returns

string resulting from zero or more replacement(s)

Source
NumericString.scala
def replace(target: CharSequence, replacement: CharSequence): String

Returns the new String resulting from replacing all occurrences of CharSequence target with replacement.

Returns the new String resulting from replacing all occurrences of CharSequence target with replacement.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

replacement

character sequence that will take its place

target

character sequence to replace

Attributes

Returns

string resulting from zero or more replacement(s)

Source
NumericString.scala
def replaceAll(regex: String, replacement: String): String

Returns the new String resulting from replacing all regex string matches with the replacement string.

Returns the new String resulting from replacing all regex string matches with the replacement string.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

regex

regular expression string

replacement

string to replace in place of any regular expression matches in the original NumericString

Attributes

Returns

string resulting from zero or more replacement(s)

Source
NumericString.scala
def replaceAllLiterally(literal: String, replacement: String): String

Replace all literal occurrences of literal with the string replacement. This is equivalent to java.lang.String#replaceAll except that both arguments are appropriately quoted to avoid being interpreted as metacharacters.

Replace all literal occurrences of literal with the string replacement. This is equivalent to java.lang.String#replaceAll except that both arguments are appropriately quoted to avoid being interpreted as metacharacters.

Value parameters

literal

the string which should be replaced everywhere it occurs

replacement

the replacement string

Attributes

Returns

the resulting string

Source
NumericString.scala
def replaceFirst(regex: String, replacement: String): String

Returns the new String resulting from replacing the first-found regex string match with the replacement string.

Returns the new String resulting from replacing the first-found regex string match with the replacement string.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

regex

regular expression string

replacement

string to replace in place of first regular expression match in the original NumericString

Attributes

Returns

string resulting from zero or one replacement(s)

Source
NumericString.scala
def repr: String

Attributes

Source
NumericString.scala
def reverse: String

Returns new string with elements in reversed order.

Returns new string with elements in reversed order.

Attributes

Returns

A new string with all elements of this NumericString in reversed order.

Source
NumericString.scala
def reverseIterator: Iterator[Char]

An iterator yielding elements in reversed order.

An iterator yielding elements in reversed order.

Note: xs.reverseIterator is the same as xs.reverse.iterator but might be more efficient.

Attributes

Returns

an iterator yielding the elements of this NumericString in reversed order

Source
NumericString.scala
def reverseMap[B](f: Char => B): IndexedSeq[B]

Builds a new collection by applying a function to all elements of this NumericString and collecting the results in reversed order.

Builds a new collection by applying a function to all elements of this NumericString and collecting the results in reversed order.

Type parameters

B

the element type of the returned collection.

Value parameters

f

the function to apply to each element.

Attributes

Returns

a new collection resulting from applying the given function f to each element of this NumericString and collecting the results in reversed order.

Source
NumericString.scala
def sameElements[B >: Char](that: Iterable[B]): Boolean

Checks if the other iterable collection contains the same elements in the same order as this NumericString.

Checks if the other iterable collection contains the same elements in the same order as this NumericString.

Value parameters

that

the collection to compare with.

Attributes

Returns

true, if both collections contain the same elements in the same order, false otherwise.

Source
NumericString.scala
def scan(z: Char)(op: (Char, Char) => Char): IndexedSeq[Char]

Computes a prefix scan of the elements of the collection.

Computes a prefix scan of the elements of the collection.

Note: The neutral element z may be applied more than once.

Value parameters

op

the associative operator for the scan

z

neutral element for the operator op

Attributes

Returns

a new string containing the prefix scan of the elements in this NumericString

Source
NumericString.scala
def scanLeft(z: String)(op: (String, Char) => String): IndexedSeq[String]

Produces a collection containing cumulative results of applying the operator going left to right.

Produces a collection containing cumulative results of applying the operator going left to right.

Value parameters

op

the binary operator applied to the intermediate result and the element

z

the initial value

Attributes

Returns

collection with intermediate results

Source
NumericString.scala
def scanRight(z: String)(op: (Char, String) => String): IndexedSeq[String]

Produces a collection containing cumulative results of applying the operator going right to left. The head of the collection is the last cumulative result.

Produces a collection containing cumulative results of applying the operator going right to left. The head of the collection is the last cumulative result.

Value parameters

op

the binary operator applied to the intermediate result and the element

z

the initial value

Attributes

Returns

collection with intermediate results

Source
NumericString.scala
def segmentLength(p: Char => Boolean, from: Int): Int

Computes length of longest segment whose elements all satisfy some predicate.

Computes length of longest segment whose elements all satisfy some predicate.

Value parameters

from

the index where the search starts.

p

the predicate used to test elements.

Attributes

Returns

the length of the longest segment of this NumericString starting from index from such that every element of the segment satisfies the predicate p.

Source
NumericString.scala
def seq: WrappedString

A version of this collection with all of the operations implemented sequentially (i.e., in a single-threaded manner).

A version of this collection with all of the operations implemented sequentially (i.e., in a single-threaded manner).

This method returns a reference to this collection. In parallel collections, it is redefined to return a sequential implementation of this collection. In both cases, it has O(1) complexity.

Attributes

Returns

a sequential view of the collection.

Source
NumericString.scala
def size: Int

The size of this NumericString.

The size of this NumericString.

Attributes

Returns

the number of elements in this NumericString.

Source
NumericString.scala
def slice(from: Int, until: Int): String

Selects an interval of elements. The returned collection is made up of all elements x which satisfy the invariant:

Selects an interval of elements. The returned collection is made up of all elements x which satisfy the invariant:

  from <= indexOf(x) < until

Value parameters

from

the lowest index to include from this NumericString.

until

the lowest index to EXCLUDE from this NumericString.

Attributes

Returns

a string containing the elements greater than or equal to index from extending up to (but not including) index until of this NumericString.

Source
NumericString.scala
def sliding(size: Int, step: Int): Iterator[String]

Groups elements in fixed size blocks by passing a "sliding window" over them (as opposed to partitioning them, as is done in grouped.)

Groups elements in fixed size blocks by passing a "sliding window" over them (as opposed to partitioning them, as is done in grouped.)

Value parameters

size

the number of elements per group

step

the distance between the first elements of successive groups

Attributes

Returns

An iterator producing strings of size size, except the last and the only element will be truncated if there are fewer elements than size.

See also

scala.collection.Iterator, method sliding

Source
NumericString.scala
def sliding(size: Int): Iterator[String]

Groups elements in fixed size blocks by passing a "sliding window" over them (as opposed to partitioning them, as is done in grouped.) "Sliding window" step is 1 by default.

Groups elements in fixed size blocks by passing a "sliding window" over them (as opposed to partitioning them, as is done in grouped.) "Sliding window" step is 1 by default.

Value parameters

size

the number of elements per group

Attributes

Returns

An iterator producing strings of size size, except the last and the only element will be truncated if there are fewer elements than size.

See also

scala.collection.Iterator, method sliding

Source
NumericString.scala
def sortBy[B](f: Char => B)(implicit ord: Ordering[B]): String

Sorts this NumericString according to the Ordering which results from transforming an implicitly given Ordering with a transformation function.

Sorts this NumericString according to the Ordering which results from transforming an implicitly given Ordering with a transformation function.

Type parameters

B

the target type of the transformation f, and the type where the ordering ord is defined.

Value parameters

f

the transformation function mapping elements to some other domain B.

ord

the ordering assumed on domain B.

Attributes

Returns

a string consisting of the elements of this NumericString sorted according to the ordering where x < y if ord.lt(f(x), f(y)).

See also

scala.math.Ordering

Example
  NumericString("212").sortBy(_.toInt)
  res13: String = 122
Source
NumericString.scala
def sortWith(lt: (Char, Char) => Boolean): String

Sorts this NumericString according to a comparison function.

Sorts this NumericString according to a comparison function.

The sort is stable. That is, elements that are equal (as determined by lt) appear in the same order in the sorted sequence as in the original.

Value parameters

lt

the comparison function which tests whether its first argument precedes its second argument in the desired ordering.

Attributes

Returns

a string consisting of the elements of this NumericString sorted according to the comparison function lt.

Example
  NumericString("212").sortWith(_.compareTo(_) < 0)
  res14: String = 122
Source
NumericString.scala
def sorted[B >: Char](implicit ord: Ordering[B]): String

Sorts this NumericString according to an Ordering.

Sorts this NumericString according to an Ordering.

The sort is stable. That is, elements that are equal (as determined by lt) appear in the same order in the sorted sequence as in the original.

Value parameters

ord

the ordering to be used to compare elements.

Attributes

Returns

a string consisting of the elements of this NumericString sorted according to the ordering ord.

See also

scala.math.Ordering

Source
NumericString.scala
def span(p: Char => Boolean): (String, String)

Splits this NumericString into a prefix/suffix pair according to a predicate.

Splits this NumericString into a prefix/suffix pair according to a predicate.

Note: c span p is equivalent to (but possibly more efficient than) (c takeWhile p, c dropWhile p), provided the evaluation of the predicate p does not cause any side-effects.

Value parameters

p

the test predicate

Attributes

Returns

a pair of strings consisting of the longest prefix of this NumericString whose elements all satisfy p, and the rest of this NumericString.

Source
NumericString.scala
def split(regex: String): Array[String]

Returns an array of strings produced by splitting NumericString at every location matching the supplied regex; the regex-matching characters are omitted from the output.

Returns an array of strings produced by splitting NumericString at every location matching the supplied regex; the regex-matching characters are omitted from the output.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

regex

string for pattern matching

Attributes

Returns

array of strings produced by splitting NumericString at every location matching supplied regex

Source
NumericString.scala
def split(regex: String, limit: Int): Array[String]

Returns an array of strings produced by splitting NumericString at up to limit locations matching the supplied regex; the regex-matching characters are omitted from the output.

Returns an array of strings produced by splitting NumericString at up to limit locations matching the supplied regex; the regex-matching characters are omitted from the output.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

limit

maximum number of split output strings that will be generated by this function; further potential splits get ignored

regex

string for pattern matching

Attributes

Returns

array of strings produced by splitting NumericString at every location matching supplied regex, up to limit occurrences

Source
NumericString.scala
def split(separators: Array[Char]): Array[String]

Returns an array of Strings resulting from splitting this NumericString at all points where one of the separators characters is encountered.

Returns an array of Strings resulting from splitting this NumericString at all points where one of the separators characters is encountered.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

separators

array of characters, any of which are valid split triggers

Attributes

Returns

array of strings, after splitting NumericString at all points where one of the separators characters is encountered

Source
NumericString.scala
def split(separator: Char): Array[String]

Split this NumericString around the separator character

Split this NumericString around the separator character

If this NumericString is the empty string, returns an array of strings that contains a single empty string.

If this NumericString is not the empty string, returns an array containing the substrings terminated by the start of the string, the end of the string or the separator character, excluding empty trailing substrings

The behaviour follows, and is implemented in terms of String.split(re: String)

Value parameters

separator

the character used as a delimiter

Attributes

Example
scala> NumericString("1234").split('3')
res15: Array[String] = Array(12, 4)
//
//splitting the empty string always returns the array with a single
//empty string
scala> NumericString("").split('3')
res16: Array[String] = Array("")
//
//only trailing empty substrings are removed
scala> NumericString("1234").split('4')
res17: Array[String] = Array(123)
//
scala> NumericString("1234").split('1')
res18: Array[String] = Array("", 234)
//
scala> NumericString("12341").split('1')
res19: Array[String] = Array("", 234)
//
scala> NumericString("11211").split('1')
res20: Array[String] = Array("", "", 2)
//
//all parts are empty and trailing
scala> NumericString("1").split('1')
res21: Array[String] = Array()
//
scala> NumericString("11").split('1')
res22: Array[String] = Array()
Source
NumericString.scala
def splitAt(n: Int): (String, String)

Splits this NumericString into two at a given position. Note: c splitAt n is equivalent to (but possibly more efficient than) (c take n, c drop n).

Splits this NumericString into two at a given position. Note: c splitAt n is equivalent to (but possibly more efficient than) (c take n, c drop n).

Value parameters

n

the position at which to split.

Attributes

Returns

a pair of strings consisting of the first n elements of this NumericString, and the other elements.

Source
NumericString.scala
def startsWith(prefix: String): Boolean

Returns true if the NumericString content completely matches the supplied prefix, when both strings are aligned at their startpoints up to the length of prefix.

Returns true if the NumericString content completely matches the supplied prefix, when both strings are aligned at their startpoints up to the length of prefix.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

prefix

string for comparison as prefix

Attributes

Returns

true if NumericString content is the same as prefix for the entire length of prefix false otherwise.

Source
NumericString.scala
def startsWith(prefix: String, toffset: Int): Boolean

Returns true if the NumericString content completely matches the supplied prefix, starting at toffset characters in the NumericString.

Returns true if the NumericString content completely matches the supplied prefix, starting at toffset characters in the NumericString.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

prefix

string for comparison as prefix

toffset

zero-based integer start point for comparison within the NumericString

Attributes

Returns

true if NumericString content is the same as prefix for the entire length of prefix shifted over, false otherwise.

Source
NumericString.scala
def stringPrefix: String

Defines the prefix of this object's toString representation.

Defines the prefix of this object's toString representation.

Attributes

Returns

a string representation which starts the result of toString applied to this NumericString. By default the string prefix is the simple name of the collection class NumericString.

Source
NumericString.scala
def stripLineEnd: String

Strip trailing line end character from this string if it has one.

Strip trailing line end character from this string if it has one.

A line end character is one of

  • LF - line feed (0x0A hex)
  • FF - form feed (0x0C hex)

If a line feed character LF is preceded by a carriage return CR (0x0D hex), the CR character is also stripped (Windows convention).

Attributes

Source
NumericString.scala
def stripMargin: String

Strip a leading prefix consisting of blanks or control characters followed by | from the line.

Strip a leading prefix consisting of blanks or control characters followed by | from the line.

Attributes

Source
NumericString.scala
def stripMargin(marginChar: Char): String

Strip a leading prefix consisting of blanks or control characters followed by marginChar from the line.

Strip a leading prefix consisting of blanks or control characters followed by marginChar from the line.

Attributes

Source
NumericString.scala
def stripPrefix(prefix: String): String

Returns this NumericString as a string with the given prefix stripped. If this NumericString does not start with prefix, it is returned unchanged.

Returns this NumericString as a string with the given prefix stripped. If this NumericString does not start with prefix, it is returned unchanged.

Attributes

Source
NumericString.scala
def stripSuffix(suffix: String): String

Returns this NumericString as a string with the given suffix stripped. If this NumericString does not end with suffix, it is returned unchanged.

Returns this NumericString as a string with the given suffix stripped. If this NumericString does not end with suffix, it is returned unchanged.

Attributes

Source
NumericString.scala
def subSequence(beginIndex: Int, endIndex: Int): CharSequence

Returns the character sequence extracted from NumericString beginning at zero-based offset beginIndex and continuing until (but not including) offset endIndex.

Returns the character sequence extracted from NumericString beginning at zero-based offset beginIndex and continuing until (but not including) offset endIndex.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

beginIndex

zero-based integer offset at which character extraction begins

endIndex

zero-based integer offset before which character extraction ends

Attributes

Returns

CharSequence of zero or more extracted characters

Source
NumericString.scala
def substring(beginIndex: Int): String

Returns a string extracted from NumericString from the zero-based beginIndex through the end of the string.

Returns a string extracted from NumericString from the zero-based beginIndex through the end of the string.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

beginIndex

zero-based integer offset at which substring extraction begins (continues through end of NumericIndex string)

Attributes

Returns

returns string extracted from NumericString

Source
NumericString.scala
def substring(beginIndex: Int, endIndex: Int): String

Returns a string extracted NumericString starting from the zero-based beginIndex through but not including the zero-based endIndex offset.

Returns a string extracted NumericString starting from the zero-based beginIndex through but not including the zero-based endIndex offset.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Value parameters

beginIndex

zero-based integer offset at which substring extraction begins

endIndex

zero-based integer offset before which substring extraction ends

Attributes

Returns

returns string extracted from NumericString

Source
NumericString.scala
def sum[B >: Char](implicit num: Numeric[B]): B

Sums up the elements of this collection.

Sums up the elements of this collection.

Attributes

Returns

the sum of all character values in this NumericString

Source
NumericString.scala
def tail: String

Selects all elements except the first.

Selects all elements except the first.

Attributes

Returns

a string consisting of all elements of this NumericString except the first one.

Throws
UnsupportedOperationException

if the NumericString is empty.

Source
NumericString.scala
def tails: Iterator[String]

Iterates over the tails of this NumericString. The first value will be this NumericString as a string and the final one will be an empty string, with the intervening values the results of successive applications of tail.

Iterates over the tails of this NumericString. The first value will be this NumericString as a string and the final one will be an empty string, with the intervening values the results of successive applications of tail.

Attributes

Returns

an iterator over all the tails of this NumericString

Example
scala> NumericString("123").tails.toList
res31: List[String] = List(123, 23, 3, "")
Source
NumericString.scala
def take(n: Int): String

Selects first ''n'' elements.

Selects first ''n'' elements.

Value parameters

n

the number of elements to take from this NumericString.

Attributes

Returns

a string consisting only of the first n elements of this NumericString, or else the whole NumericString, if it has less than n elements.

Source
NumericString.scala
def takeRight(n: Int): String

Selects last ''n'' elements.

Selects last ''n'' elements.

Value parameters

n

the number of elements to take

Attributes

Returns

a string consisting only of the last n elements of this NumericString, or else the whole NumericString, if it has less than n elements.

Source
NumericString.scala
def takeWhile(p: Char => Boolean): String

Takes longest prefix of elements that satisfy a predicate.

Takes longest prefix of elements that satisfy a predicate.

Value parameters

p

The predicate used to test elements.

Attributes

Returns

the longest prefix of this NumericString whose elements all satisfy the predicate p.

Source
NumericString.scala
def toArray: Array[Char]

Converts this NumericString to an array.

Converts this NumericString to an array.

Attributes

Returns

an array containing all elements of this NumericString.

Source
NumericString.scala
def toBuffer[A1 >: Char]: Buffer[A1]

Uses the contents of this NumericString to create a new mutable buffer.

Uses the contents of this NumericString to create a new mutable buffer.

Attributes

Returns

a buffer containing all elements of this NumericString.

Source
NumericString.scala
def toByte: Byte

Parse as a Byte

Parse as a Byte

Attributes

Throws
java.lang.NumberFormatException

If the string does not contain a parsable Byte.

Source
NumericString.scala
def toCharArray: Array[Char]

Returns an array of Unicode characters corresponding to the NumericString.

Returns an array of Unicode characters corresponding to the NumericString.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Attributes

Returns

array of Unicode characters corresponding to the NumericString

Source
NumericString.scala
def toDouble: Double

Parse as a Double.

Parse as a Double.

Attributes

Throws
java.lang.NumberFormatException

If the string does not contain a parsable Double.

Source
NumericString.scala
def toFloat: Float

Parse as a Float.

Parse as a Float.

Attributes

Throws
java.lang.NumberFormatException

If the string does not contain a parsable Float.

Source
NumericString.scala
def toIndexedSeq: IndexedSeq[Char]

Converts this NumericString to an indexed sequence.

Converts this NumericString to an indexed sequence.

Attributes

Returns

an indexed sequence containing all elements of this NumericString.

Source
NumericString.scala
def toInt: Int

Parse as an Int

Parse as an Int

Attributes

Throws
java.lang.NumberFormatException

If the string does not contain a parsable Int.

Source
NumericString.scala
def toIterable: Iterable[Char]

Converts this NumericString to an iterable collection.

Converts this NumericString to an iterable collection.

Attributes

Returns

an Iterable containing all elements of this NumericString.

Source
NumericString.scala
def toIterator: Iterator[Char]

Returns an Iterator over the elements in this NumericString.

Returns an Iterator over the elements in this NumericString.

Attributes

Returns

an Iterator containing all elements of this NumericString.

Source
NumericString.scala
def toList: List[Char]

Converts this NumericString to a list.

Converts this NumericString to a list.

Attributes

Returns

a list containing all elements of this NumericString.

Source
NumericString.scala
def toLong: Long

Parse as a Long.

Parse as a Long.

Attributes

Throws
java.lang.NumberFormatException

If the string does not contain a parsable Long.

Source
NumericString.scala
def toSeq: Seq[Char]

Converts this NumericString to a sequence.

Converts this NumericString to a sequence.

Attributes

Returns

a sequence containing all elements of this NumericString.

Source
NumericString.scala
def toSet[B >: Char]: Set[B]

Converts this NumericString to a set.

Converts this NumericString to a set.

Attributes

Returns

a set containing all elements of this NumericString.

Source
NumericString.scala
def toShort: Short

Parse as a Short.

Parse as a Short.

Attributes

Throws
java.lang.NumberFormatException

If the string does not contain a parsable Short.

Source
NumericString.scala
def toStream: Stream[Char]

Converts this NumericString to a stream.

Converts this NumericString to a stream.

Attributes

Returns

a stream containing all elements of this NumericString.

Source
NumericString.scala
override def toString: String

A string representation of this NumericString.

A string representation of this NumericString.

Attributes

Definition Classes
Any
Source
NumericString.scala
def toTraversable: Iterable[Char]

Converts this NumericString to an unspecified Traversable.

Converts this NumericString to an unspecified Traversable.

Attributes

Returns

a Traversable containing all elements of this NumericString.

Source
NumericString.scala
def toVector: Vector[Char]

Converts this NumericString to a Vector.

Converts this NumericString to a Vector.

Attributes

Returns

a vector containing all elements of this NumericString.

Source
NumericString.scala
def trim: String

Return new string resulting from removing any whitespace characters from the start and end of the NumericString.

Return new string resulting from removing any whitespace characters from the start and end of the NumericString.

For more detail, see the documentation for the corresponding method in the Javadoc documentation for java.lang.String.

Attributes

Returns

string resulting from removing any whitespace characters from start and end of original string

Source
NumericString.scala
def union(that: Seq[Char]): IndexedSeq[Char]

Produces a new sequence which contains all elements of this NumericString and also all elements of a given sequence. xs union ys is equivalent to xs ++ ys.

Produces a new sequence which contains all elements of this NumericString and also all elements of a given sequence. xs union ys is equivalent to xs ++ ys.

Another way to express this is that xs union ys computes the order-preserving multi-set union of xs and ys. union is hence a counter-part of diff and intersect which also work on multi-sets.

Attributes

Returns

a new string which contains all elements of this NumericString followed by all elements of that.

Source
NumericString.scala
def updated(index: Int, elem: NumericChar): NumericString

A copy of this NumericString with one single replaced element.

A copy of this NumericString with one single replaced element.

Value parameters

elem

the replacing element

index

the position of the replacement

Attributes

Returns

a string copy of this NumericString with the element at position index replaced by elem.

Throws
IndexOutOfBoundsException

if index does not satisfy 0 <= index < length.

Source
NumericString.scala
def view: StringView

Creates a non-strict view of this NumericString.

Creates a non-strict view of this NumericString.

Attributes

Returns

a non-strict view of this NumericString.

Source
NumericString.scala
def withFilter(p: Char => Boolean): WithFilter

Creates a non-strict filter of this NumericString.

Creates a non-strict filter of this NumericString.

Note: the difference between c filter p and c withFilter p is that the former creates a new collection, whereas the latter only restricts the domain of subsequent map, flatMap, foreach, and withFilter operations.

Value parameters

p

the predicate used to test elements.

Attributes

Returns

an object of class WithFilter, which supports map, flatMap, foreach, and withFilter operations. All these operations apply to those elements of this NumericString which satisfy the predicate p.

Source
NumericString.scala
def zip[B](that: Iterable[B]): Iterable[(Char, B)]

Returns a Iterable of pairs formed from this NumericString and another iterable collection by combining corresponding elements in pairs. If one of the two collections is longer than the other, its remaining elements are ignored.

Returns a Iterable of pairs formed from this NumericString and another iterable collection by combining corresponding elements in pairs. If one of the two collections is longer than the other, its remaining elements are ignored.

Type parameters

B

the type of the second half of the returned pairs

Value parameters

that

The iterable providing the second half of each result pair

Attributes

Returns

a collection containing pairs consisting of corresponding elements of this NumericString and that. The length of the returned collection is the minimum of the lengths of this NumericString and that.

Source
NumericString.scala
def zipAll[A1 >: Char, B](that: Iterable[B], thisElem: A1, thatElem: B): Iterable[(A1, B)]

Returns a collection of pairs formed from this NumericString and another iterable collection by combining corresponding elements in pairs. If one of the two collections is shorter than the other, placeholder elements are used to extend the shorter collection to the length of the longer.

Returns a collection of pairs formed from this NumericString and another iterable collection by combining corresponding elements in pairs. If one of the two collections is shorter than the other, placeholder elements are used to extend the shorter collection to the length of the longer.

Type parameters

B

the type of the second half of the returned pairs

Value parameters

that

the iterable providing the second half of each result pair

thatElem

the element to be used to fill up the result if that is shorter than this NumericString.

thisElem

the element to be used to fill up the result if this NumericString is shorter than that.

Attributes

Returns

a new Iterable consisting of corresponding elements of this NumericString and that. The length of the returned collection is the maximum of the lengths of this NumericString and that. If this NumericString is shorter than that, thisElem values are used to pad the result. If that is shorter than this NumericString, thatElem values are used to pad the result.

Source
NumericString.scala
def zipWithIndex: Iterable[(Char, Int)]

Zips this NumericString with its indices.

Zips this NumericString with its indices.

Attributes

Returns

A new Iterable containing pairs consisting of all characters of this NumericString paired with their index. Indices start at 0.

Example
scala> NumericString("123").zipWithIndex
res41: scala.collection.immutable.IndexedSeq[(Char, Int)] = Vector((1,0), (2,1), (3,2))
Source
NumericString.scala

Concrete fields

val value: String

Attributes

Source
NumericString.scala