Class

colossus.parsing.Combinators

LineParser

Related Doc: package Combinators

Permalink

class LineParser[T] extends Parser[T] with FastArrayBuilding

Parse a single line of data. A "line" is terminated by \r\n.

This is quite possibly the fastest line parser in existence. While this is basically a specialized version of the bytesUntil parser, it is significantly faster. Part of the speedup is simply from basically including the functionality of the MapParser, which avoids a bunch of function calls. I believe the rest of the speedup is due to the fact that comparing the next byte to a constant vs an array member is significantly faster. I have made several attempts to get the bytesUntil parser as fast as this one to no avail.

Linear Supertypes
FastArrayBuilding, Parser[T], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. LineParser
  2. FastArrayBuilding
  3. Parser
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new LineParser(constructor: (Array[Byte]) ⇒ T, includeNewline: Boolean = false, internalBufferBaseSize: Int = 100)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def <~[B](b: Parser[B]): Parser[T]

    Permalink
    Definition Classes
    Parser
  4. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  5. def >>[B](f: (T) ⇒ B): Parser[B]

    Permalink
    Definition Classes
    Parser
  6. def andThen[B](b: Parser[B]): Parser[~[T, B]]

    Permalink
    Definition Classes
    Parser
  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def complete(): Array[Byte]

    Permalink
    Definition Classes
    FastArrayBuilding
  10. def endOfStream(): Option[T]

    Permalink

    This can be optionally implemented if a parser is able to return a partial value or for situations where the end of the stream signals a complete response

    This can be optionally implemented if a parser is able to return a partial value or for situations where the end of the stream signals a complete response

    Only the unknownLengthBytes parser currently uses this. It is currently undefined if calling this resets a parser's state. ">>" also uses it, but not |>

    Definition Classes
    Parser
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def flatMap[B](f: (T) ⇒ Parser[B]): Parser[B]

    Permalink
    Definition Classes
    Parser
  15. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  17. def initSize: Int

    Permalink
    Definition Classes
    LineParserFastArrayBuilding
  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. def map[B](f: (T) ⇒ B): Parser[B]

    Permalink
    Definition Classes
    Parser
  20. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. def parse(buffer: DataBuffer): Option[T]

    Permalink
    Definition Classes
    LineParserParser
  24. var scanByte: Byte

    Permalink
  25. def shrinkOnComplete: Boolean

    Permalink
    Definition Classes
    LineParserFastArrayBuilding
  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  28. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. def write(bytes: Array[Byte]): Unit

    Permalink
    Definition Classes
    FastArrayBuilding
  32. def write(buffer: DataBuffer, bytes: Int): Unit

    Permalink
    Definition Classes
    FastArrayBuilding
  33. final def write(b: Byte): Unit

    Permalink
    Definition Classes
    FastArrayBuilding
    Annotations
    @inline()
  34. def written: Int

    Permalink
    Definition Classes
    FastArrayBuilding
  35. def |>[B](f: (T) ⇒ Parser[B]): Parser[B]

    Permalink
    Definition Classes
    Parser
  36. def ~[B](b: Parser[B]): Parser[~[T, B]]

    Permalink
    Definition Classes
    Parser
  37. def ~>[B](b: Parser[B]): Parser[B]

    Permalink
    Definition Classes
    Parser

Inherited from FastArrayBuilding

Inherited from Parser[T]

Inherited from AnyRef

Inherited from Any

Ungrouped