Form

org.specs2.form.Form
See theForm companion object
class Form(val title: Option[String], val rows: Seq[Row], val result: Option[Result]) extends Executable, Text

A Form is a container for Rows (@see Row) where each row contain some Cell (@see Cell). It has an optional title and possibly no rows.

A Form can be executed by executing each row and collecting the results.

Attributes

Companion
object
Graph
Supertypes
trait Text
trait Executable
class Object
trait Matchable
class Any
Known subtypes
class InlinedForm

Members list

Value members

Concrete methods

override def equals(a: Any): Boolean

Compares the receiver object (this) with the argument object (that) for equivalence.

Compares the receiver object (this) with the argument object (that) for equivalence.

Any implementation of this method should be an equivalence relation:

  • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
  • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).

Value parameters

that

the object to compare against this object for equality.

Attributes

Returns

true if the receiver object is equivalent to the argument; false otherwise.

Definition Classes
Any
def execute: Result

execute all rows

execute all rows

Attributes

Returns

a logical and on all results

execute all rows

execute all rows

Attributes

Returns

an executed Form

def executeRows: Seq[Row]
override def hashCode: Int

Calculate a hash code value for the object.

Calculate a hash code value for the object.

The default hashing algorithm is platform dependent.

Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

Attributes

Returns

the hash code value for this object.

Definition Classes
Any

transform this form to a form that will be added as a element inside another form

transform this form to a form that will be added as a element inside another form

Attributes

def sequence(f1: Iterable[Form], f2: Iterable[Form]): Form
def sequence[T : HasForm](f1: Seq[T], f2: Seq[T]): Form
def set(f1: Iterable[Form], f2: Iterable[Form]): Form
def set[T : HasForm](f1: Seq[T], f2: Seq[T]): Form

Attributes

Returns

a Form where every Row is executed with a Failure

Attributes

Returns

a Form where every Row is executed with a Pending

def setResult(r: Result): Form

Attributes

Returns

a Form where every Row is executed with a given Result

Attributes

Returns

a Form where every Row is executed with a Skipped

Attributes

Returns

a Form where every Row is executed with a Success

def subsequence(f1: Iterable[Form], f2: Iterable[Form]): Form
def subsequence[T : HasForm](f1: Seq[T], f2: Seq[T]): Form
def subset(f1: Iterable[Form], f2: Iterable[Form]): Form
def subset[T : HasForm](f1: Seq[T], f2: Seq[T]): Form
def tabs[T](values: Seq[T])(f: T => Tabs): Form

create new tabs in the Form

create new tabs in the Form

Attributes

def text: String

Attributes

Returns

the printed form with a padding space size to use for each cell

def th(hs: Seq[Field[_]]): Form

add a new Header with some fields

add a new Header with some fields

Attributes

def th(h1: Field[_], hs: Field[_]*): Form

add a new Header, with at least one Field

add a new Header, with at least one Field

Attributes

def th(hs: Seq[String])(implicit p: ImplicitParam): Form

add a new Header

add a new Header

Attributes

def th(h1: String, hs: String*): Form

add a new Header, with at least one Field

add a new Header, with at least one Field

Attributes

def toCellXml(implicit args: Arguments): Elem

Attributes

Returns

an xml description of this form, to be embedded in a Cell

def toEffect(label: String): Effect[Form]

encapsulate this form into an effect

encapsulate this form into an effect

Attributes

def toProp(label: String): Prop[Form, Any]

encapsulate this form into a Prop

encapsulate this form into a Prop

Attributes

def toXml(implicit args: Arguments): Elem

Attributes

Returns

an xml description of this form

def tr(c1: Cell, cs: Cell*): Form

add a new Row, with at least one Cell

add a new Row, with at least one Cell

Attributes

def tr(row: Row): Form

add a new Row

add a new Row

Attributes

def trs[T](values: Seq[T])(f: T => Row): Form

create new rows in the Form

create new rows in the Form

Attributes

Inherited methods

def map(f: Result => Result): Executable

modify the result to return

modify the result to return

Attributes

Inherited from:
Executable
def width: Int

Attributes

Returns

the width of the cell, without borders when it's a FormCell

Inherited from:
Text

Concrete fields

lazy val allRows: Seq[Row]

Attributes

Returns

all rows, including the header

lazy val maxSizes: Seq[Int]

Attributes

Returns

the maximum cell size, column by column

val result: Option[Result]
val rows: Seq[Row]
val title: Option[String]