Packages

package util

Additional utilities that need a home

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. util
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. class DoubleMap extends AnyRef
  2. trait DoubleTotalOrderTrait extends Order[Double] with Hash[Double]

    An Order[Double] instance which produces a total order by ordering NaNs above all other Doubles

    An Order[Double] instance which produces a total order by ordering NaNs above all other Doubles

    Contrary to the specification of cats, the DoubleOrdering in cats.kernel is not total because NaN is not ordered (all comparisons return false). This behaviour is consistent with IEEE-754, but not very practical.

    java.lang.Double.compare orders NaN to be largest of all Doubles.

    See https://github.com/scala/scala/pull/8721 See https://github.com/scala/scala/blob/39e82c3f904380f0b40d106723747faf881640d4/src/library/scala/math/Ordering.scala#L465

  3. trait FloatTotalOrderTrait extends Order[Float] with Hash[Float]

    See DoubleTotalOrder

  4. class IntMap extends AnyRef
  5. final class LongMap extends AnyRef

    This class implements mutable maps with Long keys based on a hash table with open addressing.

    This class implements mutable maps with Long keys based on a hash table with open addressing.

    Basic map operations on single entries, including contains and get, are typically substantially faster with LongMap than HashMap. Methods that act on the whole map, including foreach and map are not in general expected to be faster than with a generic map, save for those that take particular advantage of the internal structure of the map: foreachKey, foreachValue, mapValuesNow, and transformValues.

    Maps with open addressing may become less efficient at lookup after repeated addition/removal of elements. Although LongMap makes a decent attempt to remain efficient regardless, calling repack on a map that will no longer have elements removed but will be used heavily may save both time and storage space.

    This map is not intended to contain more than 229 entries (approximately 500 million). The maximum capacity is 230, but performance will degrade rapidly as 2^30 is approached.

  6. trait OrderInstances extends AnyRef

Value Members

  1. def buildStr(count: Int, total: Int, callback: (Int) => String, break: => String = " ... "): String

    Creates a string out of count number of elements extracted from total elements between offsets [0 ...

    Creates a string out of count number of elements extracted from total elements between offsets [0 ... count / 2) and (total - count / 2 ... total), using a callback that generates a string at each offset, and inserting a break string if count > total.

    count

    Number of elements to print

    total

    Total number of elements in sequence

    callback

    Generates a string at each offset

    break

    Produces a string to insert as a break

  2. final def dividePositiveRoundUp(a: Long, b: Long): Long
    Annotations
    @inline()
  3. final def dividePositiveRoundUp(a: Int, b: Int): Int
    Annotations
    @inline()
  4. def grab[T](arr: Array[T], n: Int): Seq[T]

    Takes n elements from the front and from the back of array

    Takes n elements from the front and from the back of array

    arr

    Array

    n

    Number of elements to take

  5. object Concat

    Provides a way to append two arrays of possibly different types together by intelligently promoting primitive types where possible.

    Provides a way to append two arrays of possibly different types together by intelligently promoting primitive types where possible.

    Key method is Concat.append(array1, array2)

  6. object DoubleTotalOrder extends DoubleTotalOrderTrait
  7. object FloatTotalOrder extends FloatTotalOrderTrait
  8. object LongMap

Inherited from AnyRef

Inherited from Any

Ungrouped