Packages

  • package root
    Definition Classes
    root
  • package molecule
    Definition Classes
    root
  • package boilerplate
    Definition Classes
    molecule
  • package api
    Definition Classes
    boilerplate
  • trait KeywordsStable extends AnyRef

    Keywords to mark aggregate expressions on and unifications of attributes.

    Keywords to mark aggregate expressions on and unifications of attributes.

    // Aggregates on any attribute type
    Person.age(count).get.map(_.head ==> 3)         // count of asserted `age` attribute values
    Person.age(countDistinct).get.map(_.head ==> 3) // count of asserted distinct `age` attribute values
    Person.age(max).get.map(_.head ==> 38)          // maximum `age` value (using `compare`)
    Person.age(min).get.map(_.head ==> 5)           // maximum `age` value (using `compare`)
    Person.age(rand).get.map(_.head ==> 25)         // single random `age` value
    Person.age(sample).get.map(_.head ==> 27)       // single sample `age` value (when single value, same as random)
    
    // Aggregates on any attribute type, returning multiple values
    Person.age(distinct).get.map(_.head ==> Vector(5, 7, 38)) // distinct `age` values
    Person.age(max(2)).get.map(_.head ==> Vector(38, 7))      // 2 maximum `age` values
    Person.age(min(2)).get.map(_.head ==> Vector(5, 7))       // 2 minimum `age` values
    Person.age(rand(2)).get.map(_.head ==> Stream(5, ?))      // 2 random `age` values (values can re-occur)
    Person.age(sample(2)).get.map(_.head ==> Vector(7, 38))   // 2 sample `age` values
    
    // Aggregates on number attributes
    Person.age(sum).get.map(_.head ==> 50)                  // sum of all `age` numbers
    Person.age(avg).get.map(_.head ==> 16.66666667)         // average of all `age` numbers
    Person.age(median).get.map(_.head ==> 7)                // median of all `age` numbers
    Person.age(stddev).get.map(_.head ==> 15.107025591499)  // standard deviation of all `age` numbers
    Person.age(variance).get.map(_.head ==> 228.2222222222) // variance of all `age` numbers
    Definition Classes
    api
  • AggrCoalesce
  • AggrInt
  • AggrKw
  • Kw
  • avg
  • bi
  • count
  • countDistinct
  • distinct
  • max
  • maxs
  • median
  • min
  • mins
  • rand
  • rands
  • sample
  • samples
  • stddev
  • sum
  • unify
  • v1
  • variance

trait min extends AggrKw

Minimum attribute value(s).

Apply min keyword to attribute to return the minimum attribute value of entities matching the molecule.

for {
  _ <- Person.age.insert(25, 34, 37, 42, 70)
  _ <- Person.age(min).get.map(_.head ==> 25)
} yield ()

Apply min(n) to return Vector of the n smallest values.

Person.age(min(3)).get.map(_.head ==> Vector(25, 34, 37))
Source
Keywords.scala
Note

min/min(n) supports all value types (via comparators).
min(n) Can at most return the number of values that match.

Linear Supertypes
AggrKw, Kw, AnyRef, Any
Known Subclasses
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. min
  2. AggrKw
  3. Kw
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def apply(i: Int): mins

    Minimum n values of attribute.

    Minimum n values of attribute.

    Apply min(n) to attribute to return Vector of the n smallest values of entities matching the molecule.

    for {
      _ <- Person.age.insert(25, 34, 37, 42, 70)
      _ <- Person.age(min(2)).get.map(_.head ==> List(25, 34))
    } yield ()
    returns

    List[attribute-type]

    Note

    min/min(n) supports all value types (via comparators).
    Can at most return the number of values that match.

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @IntrinsicCandidate()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  15. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  16. def toString(): String
    Definition Classes
    AnyRef → Any
  17. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

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

Inherited from AggrKw

Inherited from Kw

Inherited from AnyRef

Inherited from Any

Ungrouped