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 implementing lattice based static analyses (Static Analysis Infrastructure)
    • 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 (Bytecode Assembler).

    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.

    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

    OPAL's collection library is primarily designed with high performance in mind.

    Design Goals

    OPAL's collection library is primarily designed with high performance in mind. I.e., all methods provided by the collection library are reasonably optimized. However, providing a very large number of methods is a non-goal. Overall, OPAL's collection library provides:

    • collection classes that are manually specialized for primitive data-types.
    • collection classes that are optimized for particularly small collections of values.
    • collection classes that target special use cases such as using a collection as a workset/worklist.
    • collection classes that offer special methods that minimize the number of steps when compared to general purpose methods.

    Integration With Scala's Collection Library

    Hence, OPAL's collection library complements Scala's default collection library and is not intended to replace it. Integration with Scala's collection library is primarily provided by means of iterators (OPAL's Iterators inherit from Scala's Iterators). Furthermore the companion object of each of OPAL's collection classes generally provides factory methods that facilitate the conversion from Scala collection classes to OPAL collection classes.

    Status

    The collection library is growing. Nevertheless, the existing classes are production ready.

    Definition Classes
    opalj
  • package immutable
    Definition Classes
    collection
  • :&:
  • BitArraySet
  • Chain
  • ConstArray
  • ConstCovariantArray
  • EmptyIntArraySet
  • EmptyIntList
  • EmptyIntTrieSet
  • FilteredIntTrieSet
  • IdentityPair
  • Int2List
  • Int2ListEnd
  • Int2ListNode
  • IntArray
  • IntArraySet
  • IntArraySet1
  • IntArraySetBuilder
  • IntArraySetN
  • IntIntPair
  • IntList
  • IntListNode
  • IntRefPair
  • IntTrieSet
  • IntTrieSet1
  • IntTrieSetBuilder
  • IntWorkSet
  • LargeLongLinkedTrieSet
  • Long2List
  • Long2List0
  • LongLinkedSet
  • LongLinkedTrieSet
  • LongLinkedTrieSet0
  • LongLinkedTrieSet1
  • LongLinkedTrieSetN4
  • LongList
  • LongList0
  • LongListNode
  • LongRefPair
  • LongTrieSet
  • LongTrieSetWithList
  • LongWorkSet
  • Naught
  • NonEmptyUIDSet
  • Pair
  • Ref2List
  • RefArray
  • RefIntPair
  • UIDSet
  • UIDSet0
  • UIDSet1
  • UIDSet2
  • UIDSet3
  • UIDSetInnerNode
  • UIDSetLeaf
  • UIDTrieSet
  • UIDTrieSet0
  • UIDTrieSet1
  • 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

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

,

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.

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 :&:(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.

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

    Prepends the given element to this Chain.

  7. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def addString(b: StringBuilder): StringBuilder
    Definition Classes
    TraversableOnce
  9. def addString(b: StringBuilder, sep: String): StringBuilder
    Definition Classes
    TraversableOnce
  10. def addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder
    Definition Classes
    TraversableOnce
  11. def aggregate[B](z: ⇒ B)(seqop: (B, T) ⇒ B, combop: (B, B) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  12. 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].

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

    See also

    merge

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

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

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

    Computes the shared prefix.

  66. 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).

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

    Returns a newly created Traversable[T] collection.

    Returns a newly created Traversable[T] collection.

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

Deprecated Value Members

  1. def /:[B](z: B)(op: (B, T) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
    Annotations
    @deprecated
    Deprecated

    (Since version 2.12.10) Use foldLeft instead of /:

  2. def :\[B](z: B)(op: (T, B) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
    Annotations
    @deprecated
    Deprecated

    (Since version 2.12.10) Use foldRight instead of :\

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

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