case class Content[+Row](xs: ParIterable[Row]) extends Product with Serializable
Class to represent the rows of a Table.
At present, the rows are implemented as a ParIterable.
However, we might later change the internal representation; thus xs is private.
In general, however, you should probably expect that storing rows inside Content will force
an aggregation of all rows.
There are alternatives (using InputProcessor) that allow you to process an Iterator[Input] and
yield an Iterator[Row].
- Row
the underlying Row type.
- xs
a ParIterable[Row].
- Alphabetic
- By Inheritance
- Content
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Content(xs: ParIterable[Row])
- xs
a ParIterable[Row].
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def ++[B >: Row](other: Content[B]): Content[B]
Method to concatenate two Contents.
Method to concatenate two Contents. CONSIDER perhaps we should use the combiner functionality more directly? (It's what the ++ method uses).
- B
the underlying type of the other Content and the result. Must be a super-type of Row.
- other
the other Content.
- returns
Content[B].
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def drop(n: Int): Content[Row]
Drops the first
nelements from the underlying collectionxsand returns a newContentinstance containing the remaining elements.Drops the first
nelements from the underlying collectionxsand returns a newContentinstance containing the remaining elements.The method does not modify the original collection but instead creates a new
Contentinstance with the result of thedropoperation applied toxs.- n
the number of elements to drop from the start of the collection. If
nis greater than the size of the collection, an emptyContentis returned.- returns
a new
Content[Row]containing the elements of the collection after dropping the firstnelements.
- def dropWhile(p: (Row) => Boolean): Content[Row]
Drops elements from this
Content[Row]collection as long as the given predicatepevaluates to true, and returns the remaining elements wrapped in a newContent.Drops elements from this
Content[Row]collection as long as the given predicatepevaluates to true, and returns the remaining elements wrapped in a newContent.The elements are checked in their order, and once the predicate returns false for the first time, no further elements are dropped, and the remaining elements are included in the resulting
Content.- p
a predicate function of type
Row => Boolean. This function determines whether an element should be dropped. Elements for which the predicate returns true are removed from the start of the collection.- returns
a new
Content[Row]containing the elements of thisContentafter all leading elements satisfying the predicatephave been removed.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def filter(p: (Row) => Boolean): Content[Row]
Filters the rows in this content based on the given predicate.
Filters the rows in this content based on the given predicate.
- p
a predicate function that determines whether a given Row should be included in the resulting Content. The function should return true for rows that should be included and false otherwise.
- returns
a new Content[Row] containing only the rows from this content that satisfy the given predicate.
- def filterNot(p: (Row) => Boolean): Content[Row]
Filters the rows of this
Content[Row]by removing those that satisfy the given predicate function.Filters the rows of this
Content[Row]by removing those that satisfy the given predicate function.- p
the predicate function that determines whether a
Rowshould be excluded. Rows for which this function evaluates to true will be excluded from the resultingContent.- returns
a new
Content[Row]containing only the rows that do not satisfy the given predicate function.
- def flatMap[B](f: (Row) => ParIterable[B]): Content[B]
This is not, strictly speaking, the correct definition of flatMap for allowing Content to be a monad.
This is not, strictly speaking, the correct definition of flatMap for allowing Content to be a monad.
- B
the underlying type of the result.
- f
a function of type Row=>ParIterable[B]
- returns
a Content[B].
- def foldLeft[B](z: B)(op: (B, Row) => B): B
Applies a binary operator to a start value and all elements of the underlying collection
xs, going left to right, and returns a reduced value.Applies a binary operator to a start value and all elements of the underlying collection
xs, going left to right, and returns a reduced value.This method performs a fold operation, where the initial value is provided by
zand the binary operatoropis applied successively to combine elements of the collection with the accumulated result.- z
The initial value of the fold operation.
- op
A binary operator function that takes the current accumulated result and the next element of the collection, returning a new accumulated result. The function has the type
(B, Row) => B, whereBis the type of the accumulated result, andRowrepresents elements of the collection.- returns
The result of applying the fold operation over all elements of the collection. The result type is
B.
- def foreach(f: (Row) => Unit): Unit
Applies the given function
fto eachRowelement in the collection.Applies the given function
fto eachRowelement in the collection.This method iterates over all elements in the underlying sequence
xsand applies the specified functionfto each of them.- f
a function of type
Row => Unitthat is applied to each row in the collection. The function is invoked for its side effects on each element.- returns
Unitas this method is intended for side-effectful operations.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def head: Row
This should be used only by unit tests and not by code.
This should be used only by unit tests and not by code.
- returns
the first element of xs.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def iterator: Iterator[Row]
Provides an iterator to traverse the rows in this content.
Provides an iterator to traverse the rows in this content. NOTE: do not expect an iterator on Content to be in any particular order.
- returns
an
Iteratorover theRowelements of this content in their current order.
- def knownSize: Int
Returns the known size of the collection underlying this
Contentinstance.Returns the known size of the collection underlying this
Contentinstance. If the size is known, the method will return the exact size. Otherwise, it will return -1.- returns
the known size of the collection, or -1 if the size cannot be determined.
- def map[B](f: (Row) => B): Content[B]
Transforms each element in the current
Contentcollection using the given functionf.Transforms each element in the current
Contentcollection using the given functionf.- f
A function that takes an element of type
Rowand produces a new element of typeB.- returns
A new
Contentinstance containing the transformed elements of typeB.
- def mapOptional[S](f: (Row) => Option[S]): Content[S]
Transform (flatMap) this Table[Row] into a Table[S].
Transform (flatMap) this Table[Row] into a Table[S].
- S
the type of the rows of the result.
- f
a function which transforms a Row into an IterableOnce[S].
- returns
a Table[S] which is made up of a concatenation of the results of invoking f on each row this
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def sample(n: Int)(implicit random: Random): Content[Row]
Method to randomly sample from this Content.
Method to randomly sample from this Content.
- n
the odds against choosing any particular element.
- random
an (implicit) Random number generator.
- returns
a new Content[Row] with approximately size/n elements.
- def size: Int
Method to get the number of elements in the underlying collection
xs.Method to get the number of elements in the underlying collection
xs.- returns
the size of the collection as an integer.
- def slice(from: Int, until: Int): Content[Row]
Produces a slice of the content by extracting elements within the specified range.
Produces a slice of the content by extracting elements within the specified range.
This method creates a new
Content[Row]that contains elements from indexfrom(inclusive) to indexuntil(exclusive) of the underlying collectionxs. If the range specified byfromanduntilexceeds the bounds of the underlying collection, the slicing will silently handle it and only include the valid indices.- from
the starting index (inclusive) of the slice.
- until
the ending index (exclusive) of the slice.
- returns
a new
Content[Row]containing the elements in the specified range.
- def sorted[S >: Row](implicit arg0: Ordering[S]): Content[S]
Method to transform this Content[Row] into a sorted Content[S] where S is a super-class of Row and for which there is evidence of Ordering[S].
Method to transform this Content[Row] into a sorted Content[S] where S is a super-class of Row and for which there is evidence of Ordering[S].
- S
the underlying type of the resulting Table (a super-type of Row and for which there is evidence of Ordering[S]).
- returns
a Content[S].
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def take(n: Int): Content[Row]
Returns a new
Content[Row]containing the firstnelements from the currentContent[Row].Returns a new
Content[Row]containing the firstnelements from the currentContent[Row].If
nis greater than the size of the underlying collection, all elements from the collection will be included in the returnedContent[Row]. Ifnis less than or equal to zero, the result will be an emptyContent[Row].- n
the number of elements to take from the beginning of the underlying collection. Must be a non-negative integer.
- returns
a new
Content[Row]containing up to the firstnelements from the current content.
- def takeWhile(p: (Row) => Boolean): Content[Row]
Selects elements from the beginning of the underlying collection of rows, as long as they satisfy the specified predicate.
Selects elements from the beginning of the underlying collection of rows, as long as they satisfy the specified predicate. The operation stops as soon as a row is encountered that does not meet the condition.
- p
a predicate function of type
Row => Booleanthat determines whether a row should be included. The function should returntrueto select the row andfalseto stop further selection.- returns
a new
Content[Row]containing the rows from the start of the collection that satisfy the given predicate.
- def toArray[B >: Row](implicit arg0: ClassTag[B]): Array[B]
Converts the underlying collection of elements to an array.
Converts the underlying collection of elements to an array.
- B
the type of elements in the resulting array. It must be a supertype of
Rowand have an implicitClassTag.- returns
an array containing all elements of the collection.
- def toIndexedSeq: IndexedSeq[Row]
Converts the content of
xsinto anIndexedSeq[Row].Converts the content of
xsinto anIndexedSeq[Row].- returns
an IndexedSeq containing all elements of
xs.
- def toSeq: Seq[Row]
Converts the underlying collection of rows to a sequence.
Converts the underlying collection of rows to a sequence.
- returns
a sequence (Seq[Row]) containing the rows of the content.
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)