Packages

  • package root
    Definition Classes
    root
  • package org
    Definition Classes
    root
  • package opalj

    OPAL is a Scala-based framework for the static analysis, manipulation and creation of Java bytecode.

    OPAL is a Scala-based framework for the static analysis, manipulation and creation of Java bytecode. OPAL is designed with performance, scalability and adaptability in mind.

    Its main components are:

    • a library (Common) which provides generally useful data-structures and algorithms for static analyses.
    • a framework for parsing Java bytecode (Bytecode Infrastructure) that can be used to create arbitrary representations.
    • a library to create a one-to-one in-memory representation of Java bytecode (Bytecode Disassembler).
    • a library to create a representation of Java bytecode that facilitates writing simple static analyses (Bytecode Representation - org.opalj.br).
    • a scalable, easily customizable framework for the abstract interpretation of Java bytecode (Abstract Interpretation Framework - org.opalj.ai).
    • a library to extract dependencies between code elements and to facilitate checking architecture definitions.
    • a library for the lightweight manipulation and creation of Java bytecode.

    General Design Decisions

    Thread Safety

    Unless explicitly noted, OPAL is thread safe. I.e., the classes defined by OPAL can be considered to be thread safe unless otherwise stated. (For example, it is possible to read and process class files concurrently without explicit synchronization on the client side.)

    No null Values

    Unless explicitly noted, OPAL does not null values I.e., fields that are accessible will never contain null values and methods will never return null. If a method accepts null as a value for a parameter or returns a null value it is always explicitly documented. In general, the behavior of methods that are passed null values is undefined unless explicitly documented.

    No Typecasts for Collections

    For efficiency reasons, OPAL sometimes uses mutable data-structures internally. After construction time, these data-structures are generally represented using their generic interfaces (e.g., scala.collection.{Set,Map}). However, a downcast (e.g., to add/remove elements) is always forbidden as it would effectively prevent thread-safety. Furthermore, the concrete data-structure is always considered an implementation detail and may change at any time.

    Assertions

    OPAL makes heavy use of Scala's Assertion Facility to facilitate writing correct code. Hence, for production builds (after thorough testing(!)) it is highly recommend to build OPAL again using -Xdisable-assertions.

    Definition Classes
    org
  • package collection

    Defines helper methods related to Scala's and OPAL's collections APIs.

    Defines helper methods related to Scala's and OPAL's collections APIs.

    Definition Classes
    opalj
  • package immutable
    Definition Classes
    collection
  • :&:
  • Chain
  • ConstArray
  • EmptyIntArraySet
  • IdentityPair
  • IntArraySet
  • IntArraySet1
  • IntArraySetBuilder
  • IntArraySetN
  • LowLevelConstArrayImplicits
  • Naught
  • NonEmptyUIDSet
  • UIDSet
  • UIDSet0
  • UIDSet1
  • UIDSet2
  • UIDTrieSetInnerNode
  • UIDTrieSetLeaf
  • UIDTrieSetNodeLike
  • UShortPair

sealed trait Chain[+T] extends TraversableOnce[T] with FilterMonadic[T, Chain[T]] with Serializable

A linked list which does not perform any length related checks. I.e., it fails in case of drop and take etc. if the size of the list is smaller than expected. Furthermore, all directly implemented methods use while loops for maximum efficiency and the list is also specialized for primitive int values which makes this list far more efficient when used for storing lists of int values.

Self Type
Chain[T]
Source
Chain.scala
Note

Some core methods, e.g. drop and take, have different semantics when compared to the methods with the same name defined by the Scala collections API. In this case these methods may fail arbitrarily if the list is not long enough. Therefore, Chain does not inherit from scala...Seq.

,

In most cases a Chain can be used as a drop-in replacement for a standard Scala List.

Linear Supertypes
Serializable, Serializable, FilterMonadic[T, Chain[T]], TraversableOnce[T], GenTraversableOnce[T], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Chain
  2. Serializable
  3. Serializable
  4. FilterMonadic
  5. TraversableOnce
  6. GenTraversableOnce
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class ChainWithFilter extends FilterMonadic[T, Chain[T]]

    Represents a filtered Chain.

    Represents a filtered Chain. Instances of ChainWithFilter are typically created by Chain's withFilter method.

Abstract Value Members

  1. abstract def :&::[X >: T](x: Chain[X]): Chain[X]

    Prepends the given Chain to this chain.

  2. abstract def drop(n: Int): Chain[T]
  3. abstract def filter(f: (T) ⇒ Boolean): Chain[T]
  4. abstract def fuse[X >: T <: AnyRef](that: Chain[X], onDiff: (T, X) ⇒ X): Chain[X]

    Fuses this chain with the given chain by fusing the values using the given function.

    Fuses this chain with the given chain by fusing the values using the given function. The function onDiff is only called if the given list's element and this list's element differ. Hence, when the tail of both lists is equal fusing both lists will terminate immediately and the common tail is attached to the new heading.

  5. abstract def hasMultipleElements: Boolean
  6. abstract def head: T
  7. abstract def headOption: Option[T]
  8. abstract def isEmpty: Boolean
    Definition Classes
    TraversableOnce → GenTraversableOnce
  9. abstract def isSingletonList: Boolean
  10. abstract def mapConserve[X >: T <: AnyRef](f: (T) ⇒ X): Chain[X]
  11. abstract def merge[X <: AnyRef, Z >: T <: AnyRef](that: Chain[X])(f: (T, X) ⇒ Z): Chain[Z]

    Merges this chain with the given chain by merging the values using the given function.

    Merges this chain with the given chain by merging the values using the given function. If all results are the same (reference equality) as this chain's elements then the result will be this. Otherwise, only the tail that is identical will be kept.

  12. abstract def reverse: Chain[T]
  13. abstract def tail: Chain[T]
  14. abstract def take(n: Int): Chain[T]

    Takes the first n elements of this list.

    Takes the first n elements of this list. If this list does not contain at least n elements an IllegalStateException will be thrown.

    n

    An int value in the range [0...this.size].

    returns

    A list consisting of the first n value.

  15. abstract def takeUpTo(n: Int): Chain[T]

    Takes up to the first n elements of this list.

    Takes up to the first n elements of this list. The returned list will contain at most this.size elements.

    n

    An int value euqal or larger than 0.

    returns

    A list consisting of the first n value.

  16. abstract def takeWhile(f: (T) ⇒ Boolean): Chain[T]

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def ++[X >: T](other: Traversable[X]): Chain[X]
  4. def ++[X >: T](that: Chain[X]): Chain[X]
  5. def /:[B](z: B)(op: (B, T) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  6. def :&:(x: Int)(implicit ev: <:<[Chain.this.type, Chain[Int]]): Chain[Int]

    Prepends the given int value to this Chain if this chain is a chain of int values.

  7. def :&:[X >: T](x: X): Chain[X]

    Prepends the given element to this Chain.

  8. def :\[B](z: B)(op: (T, B) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  9. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def addString(b: StringBuilder): StringBuilder
    Definition Classes
    TraversableOnce
  11. def addString(b: StringBuilder, sep: String): StringBuilder
    Definition Classes
    TraversableOnce
  12. def addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder
    Definition Classes
    TraversableOnce
  13. def aggregate[B](z: ⇒ B)(seqop: (B, T) ⇒ B, combop: (B, B) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  14. def apply(index: Int): T

    Returns the value of the element of this list with the given index.

    Returns the value of the element of this list with the given index.

    index

    A valid index. A value in the range [0...this.size-1].

  15. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  16. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  17. def collectFirst[B](pf: PartialFunction[T, B]): Option[B]
    Definition Classes
    TraversableOnce
  18. def contains[X >: T](e: X): Boolean
  19. def copyToArray[B >: T](xs: Array[B], start: Int, len: Int): Unit
    Definition Classes
    Chain → TraversableOnce → GenTraversableOnce
  20. def copyToArray[B >: T](xs: Array[B]): Unit
    Definition Classes
    TraversableOnce → GenTraversableOnce
  21. def copyToArray[B >: T](xs: Array[B], start: Int): Unit
    Definition Classes
    TraversableOnce → GenTraversableOnce
  22. def copyToBuffer[B >: T](dest: Buffer[B]): Unit
    Definition Classes
    TraversableOnce
  23. def corresponds[X](other: Chain[X])(f: (T, X) ⇒ Boolean): Boolean

    See also

    merge

  24. def count(p: (T) ⇒ Boolean): Int
    Definition Classes
    TraversableOnce → GenTraversableOnce
  25. def dropWhile(f: (T) ⇒ Boolean): Chain[T]
  26. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  28. def exists(f: (T) ⇒ Boolean): Boolean
    Definition Classes
    Chain → TraversableOnce → GenTraversableOnce
  29. def filterNot(f: (T) ⇒ Boolean): Chain[T]
  30. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  31. def find(p: (T) ⇒ Boolean): Option[T]
    Definition Classes
    Chain → TraversableOnce → GenTraversableOnce
  32. def flatMap[B, That](f: (T) ⇒ GenTraversableOnce[B])(implicit bf: CanBuildFrom[Chain[T], B, That]): That
    Definition Classes
    Chain → FilterMonadic
  33. def fold[A1 >: T](z: A1)(op: (A1, A1) ⇒ A1): A1
    Definition Classes
    TraversableOnce → GenTraversableOnce
  34. def foldLeft[B](z: B)(op: (B, T) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  35. def foldRight[B](z: B)(op: (T, B) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  36. def forFirstN[U](n: Int)(f: (T) ⇒ U): Unit
  37. def forall(f: (T) ⇒ Boolean): Boolean
    Definition Classes
    Chain → TraversableOnce → GenTraversableOnce
  38. def foreach[U](f: (T) ⇒ U): Unit
    Definition Classes
    Chain → FilterMonadic → TraversableOnce → GenTraversableOnce
  39. def foreachWhile(f: (T) ⇒ Boolean): Boolean

    Executes the given function f for each element of this chain as long as it returns true.

  40. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  41. final def hasDefiniteSize: Boolean
    Definition Classes
    Chain → TraversableOnce → GenTraversableOnce
  42. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  43. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  44. final def isTraversableAgain: Boolean
    Definition Classes
    Chain → GenTraversableOnce
  45. def last: T
  46. def map[B, That](f: (T) ⇒ B)(implicit bf: CanBuildFrom[Chain[T], B, That]): That
    Definition Classes
    Chain → FilterMonadic
  47. def max[B >: T](implicit cmp: Ordering[B]): T
    Definition Classes
    TraversableOnce → GenTraversableOnce
  48. def maxBy[B](f: (T) ⇒ B)(implicit cmp: Ordering[B]): T
    Definition Classes
    TraversableOnce → GenTraversableOnce
  49. def min[B >: T](implicit cmp: Ordering[B]): T
    Definition Classes
    TraversableOnce → GenTraversableOnce
  50. def minBy[B](f: (T) ⇒ B)(implicit cmp: Ordering[B]): T
    Definition Classes
    TraversableOnce → GenTraversableOnce
  51. def mkString(pre: String, sep: String, post: String): String
    Definition Classes
    Chain → TraversableOnce → GenTraversableOnce
  52. def mkString: String
    Definition Classes
    Chain → TraversableOnce → GenTraversableOnce
  53. def mkString(sep: String): String
    Definition Classes
    TraversableOnce → GenTraversableOnce
  54. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  55. def nonEmpty: Boolean
    Definition Classes
    TraversableOnce → GenTraversableOnce
  56. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  57. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  58. def product[B >: T](implicit num: Numeric[B]): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  59. def reduce[A1 >: T](op: (A1, A1) ⇒ A1): A1
    Definition Classes
    TraversableOnce → GenTraversableOnce
  60. def reduceLeft[B >: T](op: (B, T) ⇒ B): B
    Definition Classes
    TraversableOnce
  61. def reduceLeftOption[B >: T](op: (B, T) ⇒ B): Option[B]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  62. def reduceOption[A1 >: T](op: (A1, A1) ⇒ A1): Option[A1]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  63. def reduceRight[B >: T](op: (T, B) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  64. def reduceRightOption[B >: T](op: (T, B) ⇒ B): Option[B]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  65. def reversed: List[T]
    Attributes
    protected[this]
    Definition Classes
    TraversableOnce
  66. final def seq: Chain.this.type
    Definition Classes
    Chain → TraversableOnce → GenTraversableOnce
  67. def sharedPrefix[X >: T](other: Chain[X]): Chain[T]

    Computes the shared prefix.

  68. def size: Int

    Counts the number of elements.

    Counts the number of elements.

    returns

    The size of this list.

    Definition Classes
    Chain → TraversableOnce → GenTraversableOnce
    Note

    This operation has complexity O(n).

  69. def sizeHintIfCheap: Int
    Attributes
    protected[scala.collection]
    Definition Classes
    GenTraversableOnce
  70. def startsWith[X >: T](other: Chain[X]): Boolean
  71. def sum[B >: T](implicit num: Numeric[B]): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  72. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  73. def to[Col[_]](implicit cbf: CanBuildFrom[Nothing, T, Col[T]]): Col[T]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  74. def toArray[B >: T](implicit arg0: ClassTag[B]): Array[B]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  75. def toBuffer[B >: T]: Buffer[B]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  76. def toIndexedSeq: IndexedSeq[T]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  77. def toIntArraySet(implicit ev: <:<[T, Int]): IntArraySet
  78. def toIterable: Iterable[T]
    Definition Classes
    Chain → TraversableOnce → GenTraversableOnce
  79. def toIterator: Iterator[T]
    Definition Classes
    Chain → GenTraversableOnce
  80. def toList: List[T]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  81. def toMap[T, U](implicit ev: <:<[T, (T, U)]): Map[T, U]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  82. def toSeq: Seq[T]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  83. def toSet[B >: T]: Set[B]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  84. def toStream: Stream[T]
    Definition Classes
    Chain → GenTraversableOnce
  85. def toString(): String
    Definition Classes
    AnyRef → Any
  86. def toTraversable: Traversable[T]

    Returns a newly created Traversable[T] collection.

    Returns a newly created Traversable[T] collection.

    Definition Classes
    Chain → TraversableOnce → GenTraversableOnce
  87. def toVector: Vector[T]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  88. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  89. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  90. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  91. def withFilter(p: (T) ⇒ Boolean): ChainWithFilter
    Definition Classes
    Chain → FilterMonadic
  92. def zip[X](other: Chain[X]): Chain[(T, X)]
  93. def zip[X](other: GenIterable[X]): Chain[(T, X)]
  94. def zipWithIndex: Chain[(T, Int)]

Inherited from Serializable

Inherited from Serializable

Inherited from FilterMonadic[T, Chain[T]]

Inherited from TraversableOnce[T]

Inherited from GenTraversableOnce[T]

Inherited from AnyRef

Inherited from Any

Ungrouped