o

ap.util

Seqs

object Seqs

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

Type Members

  1. abstract class BS_Result extends AnyRef
  2. abstract class FAS_RESULT[+A] extends AnyRef
  3. case class FilteredSorted[A](res: Array[A]) extends FAS_RESULT[A] with Product with Serializable
  4. case class Found(index: Int) extends BS_Result with Product with Serializable
  5. case class FoundBadElement[A](badElement: A) extends FAS_RESULT[A] with Product with Serializable
  6. case class NotFound(nextBiggerElement: Int) extends BS_Result with Product with Serializable

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def binIntersect[A, B](aEls: Iterator[A], bEls: IndexedSeq[B], compare: (A, B) => Int): Iterator[(A, B)]

    Compute the intersection of two sequences in (strictly) ascending order.

    Compute the intersection of two sequences in (strictly) ascending order. The procedure uses binary search on the second list, and should in particular perform well if the second list is much bigger than the first list. compare should return a negative number of the a argument is smaller than the b argument, a positive number if a argument is bigger than b, 0 otherwise.

  6. def binSearch[T](seq: IndexedSeq[T], begin: Int, end: Int, wanted: T)(implicit ord: Ordering[T]): BS_Result

    Binary search for an element in a sorted random-access sequent.

    Binary search for an element in a sorted random-access sequent. The result is either Found(i), where i is the index of some occurrence of wanted in seq, or NotFound(i), where i is the index of the next-bigger element in seq. Note, that elements are never compared with ==, only with (a compare b) == 0

  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  8. def computeHashCode[A](a: Iterable[A], init: Int, multiplier: Int): Int
  9. def computeHashCode[A](a: Iterator[A], init: Int, multiplier: Int): Int

    Compute a polynomial hashcode for a sequence of things

  10. def count[A](els: Iterator[A], p: (A) => Boolean): Int
  11. def count[A](els: Iterable[A], p: (A) => Boolean): Int
  12. def diff[A](newSeq: IndexedSeq[A], oldSeq: IndexedSeq[A])(implicit ord: Ordering[A]): (IndexedSeq[A], IndexedSeq[A])

    Given to sequences that are totally sorted in the same descending order, determine those elements in newSeq that also occur in oldSeq, and those elements in newSeq that do not occur in oldSeq.

  13. def diff3[A](seq0: IndexedSeq[A], seq1: IndexedSeq[A])(implicit ord: Ordering[A]): (IndexedSeq[A], IndexedSeq[A], IndexedSeq[A])

    Given to sequences that are totally sorted in the same descending order, determine those elements that only occur in seq0, those that occur in both sequences, and those that only occur in seq1.

  14. def disjoint[A](a: Set[A], b: Set[A], c: Set[A]): Boolean

    Determine whether 3 given sets have any elements in common

  15. def disjoint[A](a: Set[A], b: Set[A]): Boolean
  16. def disjointSeq[A](a1: Set[A], a2: Set[A], b: Iterator[A]): Boolean
  17. def disjointSeq[A](a1: Set[A], a2: Set[A], b: Iterable[A]): Boolean
  18. def disjointSeq[A](a: Set[A], b: Iterable[A]): Boolean
  19. def disjointSeq[A](a: Set[A], b: Iterator[A]): Boolean
  20. def doubleIterator[A](a: A, b: A): Iterator[A]

    Iterator over exactly two elements

  21. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  23. def filterAndSort[A](it: Iterator[A], skipEl: (A) => Boolean, badEl: (A) => Boolean, trafo: (A) => A, comesBefore: (A, A) => Boolean)(implicit arg0: ClassTag[A]): FAS_RESULT[A]

    Filter a sequence of objects in order to detect the existence of certain bad objects (badEl) and to remove certain unnecessary objects (skipEl).

    Filter a sequence of objects in order to detect the existence of certain bad objects (badEl) and to remove certain unnecessary objects (skipEl). If a bad element is found, FoundBadElement is returned, otherwise a sorted array with the elements that were kept is created and returned.

  24. def findDuplicates[A](els: Iterator[A]): Set[A]

    Determine all elements that occur in more than one of the given collections

  25. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  26. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  27. def identicalSeqs[A <: AnyRef](a: Iterable[A], b: Iterable[A]): Boolean

    Determine whether the two given sequences/iterables contain reference-identical objects.

  28. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  29. def lexCombineInts(int1: Int, _int2: => Int, _int3: => Int, _int4: => Int): Int
  30. def lexCombineInts(int1: Int, _int2: => Int, _int3: => Int): Int
  31. def lexCombineInts(int1: Int, int2: => Int): Int

    Interpret the given integers as results of a compare function (negative, zero, positive for less, equal, greater) and combine them lexicographically

  32. def lexCompare[T](it1: Iterator[T], it2: Iterator[T])(implicit ord: Ordering[T]): Int

    Lexicographic comparison of two lists of things

  33. def lexCompareOrdering[T](it1: Iterator[T], it2: Iterator[T])(implicit ord: Ordering[T]): Int
  34. def mapValuesStrict[A, B, C](m: Map[A, B], f: (B) => C): Map[A, C]

    Strict function to apply a function to the values of some map.

  35. def max[A, B](it: Iterator[A], measure: (A) => B)(implicit arg0: (B) => Ordered[B]): A

    Determine a maximum element of a sequence of things under a given measure

  36. def max(els: Iterable[Int]): Int

    Compute the maximum of a sequence of ints.

    Compute the maximum of a sequence of ints. If the sequence is empty, 0 is returned

  37. def max(it: Iterator[Int]): Int

    Compute the maximum of a sequence of ints.

    Compute the maximum of a sequence of ints. If the sequence is empty, 0 is returned

  38. def mergeSortedSeqs[A](aIt: Iterator[A], bIt: Iterator[A])(implicit ord: Ordering[A]): IndexedSeq[A]

    Merge two sequences that are sorted in strictly descending order and produce a descending sequence with all elements occurring in at least one of the sequences

  39. def mergeSortedSeqs[A](a: IndexedSeq[A], b: IndexedSeq[A])(implicit ord: Ordering[A]): IndexedSeq[A]

    Merge two sequences that are sorted in strictly descending order and produce a descending sequence with all elements occurring in at least one of the sequences

  40. def min[A, B](it: Iterator[A], measure: (A) => B)(implicit arg0: (B) => Ordered[B]): A

    Determine a minimum element of a sequence of things under a given measure

  41. def min[A, B](it: Iterable[A], measure: (A) => B)(implicit arg0: (B) => Ordered[B]): A

    Determine a minimum element of a sequence of things under a given measure

  42. def min(it: Iterator[Int]): Int

    Compute the minimum of a sequence of ints.

    Compute the minimum of a sequence of ints. If the sequence is empty, 0 is returned

  43. def minOption[A, B](it: Iterator[A], measure: (A) => Option[B])(implicit arg0: (B) => Ordered[B]): Option[A]
  44. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  45. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  46. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  47. def optionMax(a: Option[IdealInt], b: Option[IdealInt]): Option[IdealInt]

    Max on optional integers

  48. def optionMin(a: Option[IdealInt], b: Option[IdealInt]): Option[IdealInt]

    Min on optional integers

  49. def optionSum(vals: Iterator[Option[Int]]): Option[Int]

    Return the sum of the given numbers if all numbers are defined, None otherwise.

  50. def partialMinBy[A, B](it: Iterator[A], f: (A) => B)(implicit cmp: PartialOrdering[B]): A

    Determine a minimum element of a sequence of things under a given measure

  51. def prepend[A](els: Iterable[A], l: List[A]): List[A]

    Prepend some elements in front of a list

  52. def reduceLeft[A](els: Iterable[A], f: (A, A) => A): Option[A]

    reduceLeft that also works for empty sequences

  53. def reduceLeft[A](els: Iterator[A], f: (A, A) => A): Option[A]

    reduceLeft that also works for empty sequences

  54. def reduceToSize[A](b: Buffer[A], newSize: Int): Unit

    Remove last elements from the buffer

  55. def removeDuplicates[A](s: IndexedSeq[A]): IndexedSeq[A]

    Remove all duplicates from a sorted sequence.

    Remove all duplicates from a sorted sequence. It is assumed that duplicates can only occur immediately following each other

  56. def removeLast[A](b: Buffer[A]): Unit

    Remove the last element of some buffer.

  57. def risingEdge[A](ar: IndexedSeq[A], p: (A) => Boolean): Int

    Find the first index ind with p(ar(ind)); return 0 if p is true on the whole sequence, and end if p is false on the whole sequence.

    Find the first index ind with p(ar(ind)); return 0 if p is true on the whole sequence, and end if p is false on the whole sequence.

    p has to be monotonic on ar, i.e., if p(ar(ind)) then p(ar(ind + 1)).

  58. def risingEdgeBwd[A](ar: IndexedSeq[A], p: (A) => Boolean, start: Int): Int

    Going backward, find the first index ind in the range [0, start) with p(ar(ind)); return 0 if p is true on [0, start), and start if p is false on [0, start).

    Going backward, find the first index ind in the range [0, start) with p(ar(ind)); return 0 if p is true on [0, start), and start if p is false on [0, start).

    p has to be monotonic on ar, i.e., if p(ar(ind)) then p(ar(ind + 1)).

  59. def risingEdgeBwdFull[A](ar: IndexedSeq[A], p: (A) => Boolean, start: Int, begin: Int): Int

    Going backward, find the first index ind in the range [begin, start) with p(ar(ind)); return begin if p is true on [begin, start), and start if p is false on [begin, start).

    Going backward, find the first index ind in the range [begin, start) with p(ar(ind)); return begin if p is true on [begin, start), and start if p is false on [begin, start).

    p has to be monotonic on ar, i.e., if p(ar(ind)) then p(ar(ind + 1)).

  60. def risingEdgeFull[A](ar: IndexedSeq[A], p: (A) => Boolean, begin: Int, end: Int): Int

    Find the first index ind in the range [begin, end) with p(ar(ind)); return begin if p is true on [begin, end), and end if p is false on [begin, end).

    Find the first index ind in the range [begin, end) with p(ar(ind)); return begin if p is true on [begin, end), and end if p is false on [begin, end).

    p has to be monotonic on ar, i.e., if p(ar(ind)) then p(ar(ind + 1)).

  61. def risingEdgeFwd[A](ar: IndexedSeq[A], p: (A) => Boolean, start: Int): Int

    Going forward, find the first index ind in the range [start, ar.size) with p(ar(ind)); return start if p is true on [start, ar.size), and ar.size if p is false on [start, ar.size).

    Going forward, find the first index ind in the range [start, ar.size) with p(ar(ind)); return start if p is true on [start, ar.size), and ar.size if p is false on [start, ar.size).

    p has to be monotonic on ar, i.e., if p(ar(ind)) then p(ar(ind + 1)).

  62. def risingEdgeFwdFull[A](ar: IndexedSeq[A], p: (A) => Boolean, start: Int, end: Int): Int

    Going forward, find the first index ind in the range [start, end) with p(ar(ind)); return start if p is true on [start, end), and end if p is false on [start, end).

    Going forward, find the first index ind in the range [start, end) with p(ar(ind)); return start if p is true on [start, end), and end if p is false on [start, end).

    p has to be monotonic on ar, i.e., if p(ar(ind)) then p(ar(ind + 1)).

  63. def so2os[T](l: Seq[Option[T]]): Option[Seq[T]]

    Convert a sequence of options to an optional sequence.

  64. def some[A](vals: Iterable[Option[A]]): Option[A]
  65. def some[A](vals: Iterator[Option[A]]): Option[A]

    Return the first Some(x) of the given sequence, or None if none exists

  66. def split[A](els: Iterator[A], firstKind: (A) => Boolean): (Vector[A], Vector[A])

    Split a sequence of things into two sequences, one with all the elements for which certain predicate holds, and one with the elements for which the predicate does not hold

  67. def subSeq[A](a: Iterator[A], aFilter: Set[A], b: Iterator[A]): Boolean

    Determine whether a occurs in b as a sub-sequence

  68. def subSeq[A](a: Iterator[A], b: Iterator[A]): Boolean

    Determine whether a occurs in b as a sub-sequence

  69. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  70. def toArray[A](els: Iterator[A])(implicit arg0: ClassTag[A]): Array[A]
  71. def toStream[A](f: (Int) => A): Stream[A]

    Lazily convert a function (over naturals) to a stream

  72. def toString(): String
    Definition Classes
    AnyRef → Any
  73. def tripleIterator[A](a: A, b: A, c: A): Iterator[A]

    Iterator over exactly three elements

  74. def union[A](sets: Iterator[Set[A]]): Set[A]

    Compute union of a sequence of sets.

  75. def union[A](sets: Iterable[Set[A]]): Set[A]

    Compute union of a sequence of sets.

  76. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  77. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  78. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped