com.phasmidsoftware.lascala.values

Created by scalaprof on 1/4/17.

Attributes

Members list

Type members

Classlikes

trait Additive[X]

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
abstract class BaseBooleanScalar(x: Boolean, source: Any) extends BaseScalar

Attributes

Supertypes
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
Known subtypes
abstract class BaseDateScalar(x: LocalDate, source: Any) extends BaseScalar

Attributes

Supertypes
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
Known subtypes
class DateScalar
class DateValue
abstract class BaseDoubleScalar(x: Double, source: Any) extends BaseScalar

Attributes

Supertypes
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
Known subtypes
abstract class BaseIntScalar(x: Int, source: Any) extends BaseScalar

Attributes

Supertypes
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
Known subtypes
class IntScalar
class IntValue

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
abstract class BaseNumericFuzzy[T](t: T)(using evidence$1: Fractional[T]) extends NumericFuzzy[T]

Attributes

Companion
object
Supertypes
trait NumericFuzzy[T]
trait Fuzzy[T]
trait Ordered[Fuzzy[T]]
trait Comparable[Fuzzy[T]]
trait () => T
class Object
trait Matchable
class Any
Show all
Known subtypes
class Bounded[T]
class Exact[T]
class Gaussian[T]
Self type
abstract class BaseQuotedStringScalar(x: String, source: Any) extends BaseScalar

CONSIDER merge this and BaseStringScalar appropriately

CONSIDER merge this and BaseStringScalar appropriately

Attributes

Supertypes
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
Known subtypes
abstract class BaseRationalScalar(x: LongRational, source: Any) extends BaseScalar

Attributes

Supertypes
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
Known subtypes
abstract class BaseScalar(value: Any, source: Any) extends Scalar, Serializable

Attributes

Supertypes
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Known subtypes
abstract class BaseStringScalar(x: String, source: Any) extends BaseScalar

Attributes

Supertypes
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
Known subtypes
object BooleanScalar

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class BooleanScalar(x: Boolean, source: Any) extends BaseBooleanScalar

Scalar which is natively a Boolean. Such a value can be converted to Int by invoking asValuable[Int] in which case the result will be 1 for true and 0 for false.

Scalar which is natively a Boolean. Such a value can be converted to Int by invoking asValuable[Int] in which case the result will be 1 for true and 0 for false.

Value parameters

source

the source (which could, conceivably, be a String)

x

the Int value

Attributes

Companion
object
Supertypes
trait Product
trait Equals
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
object BooleanValue

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class BooleanValue(x: Boolean, source: Any) extends BaseBooleanScalar, Value

Value which is natively a Boolean. Such a value can be converted to Int by invoking asValuable[Int] in which case the result will be 1 for true and 0 for false.

Value which is natively a Boolean. Such a value can be converted to Int by invoking asValuable[Int] in which case the result will be 1 for true and 0 for false.

Value parameters

source

the source (which could, conceivably, be a String)

x

the Int value

Attributes

Companion
object
Supertypes
trait Product
trait Equals
trait Value
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
case class Bounded[T](nominal: T, bound: T)(using evidence$1: Fractional[T]) extends BaseNumericFuzzy[T]

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class BaseNumericFuzzy[T]
trait NumericFuzzy[T]
trait Fuzzy[T]
trait Ordered[Fuzzy[T]]
trait Comparable[Fuzzy[T]]
trait () => T
class Object
trait Matchable
class Any
Show all
object Bounded

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
Bounded.type
object DateScalar

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
DateScalar.type
case class DateScalar(x: LocalDate, source: Any) extends BaseDateScalar

Scalar which is natively an LocalDate. Such a value, cannot be converted to Int or Double by invoking asValuable. However, it can be converted to some other form of Date by invoking asOrderable[X] where X is the other form--provided that there is an implicit conversion function in scope.

Scalar which is natively an LocalDate. Such a value, cannot be converted to Int or Double by invoking asValuable. However, it can be converted to some other form of Date by invoking asOrderable[X] where X is the other form--provided that there is an implicit conversion function in scope.

Value parameters

source

the source (normally a String)

x

the LocalDate value

Attributes

Companion
object
Supertypes
trait Product
trait Equals
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
case class DateValue(x: LocalDate, source: Any) extends BaseDateScalar, Value

Value which is natively an LocalDate. Such a value, cannot be converted to Int or Double by invoking asValuable. However, it can be converted to some other form of Date by invoking asOrderable[X] where X is the other form--provided that there is an implicit conversion function in scope.

Value which is natively an LocalDate. Such a value, cannot be converted to Int or Double by invoking asValuable. However, it can be converted to some other form of Date by invoking asOrderable[X] where X is the other form--provided that there is an implicit conversion function in scope.

Value parameters

source

the source (normally a String)

x

the LocalDate value

Attributes

Companion
object
Supertypes
trait Product
trait Equals
trait Value
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
object DateValue

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
DateValue.type
case class DoubleScalar(x: Double, source: Any) extends BaseDoubleScalar

Scalar which is natively a Double. Such a value cannot be converted to Int by invoking asValuable[Int] because of loss of precision.

Scalar which is natively a Double. Such a value cannot be converted to Int by invoking asValuable[Int] because of loss of precision.

Value parameters

source

the source (which could, conceivably, be a String)

x

the Double value

Attributes

Companion
object
Supertypes
trait Product
trait Equals
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
object DoubleScalar

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class DoubleValue(x: Double, source: Any) extends BaseDoubleScalar, Value

Value which is natively a Double. Such a value cannot be converted to Int by invoking asValuable[Int] because of loss of precision.

Value which is natively a Double. Such a value cannot be converted to Int by invoking asValuable[Int] because of loss of precision.

Value parameters

source

the source (which could, conceivably, be a String)

x

the Double value

Attributes

Companion
object
Supertypes
trait Product
trait Equals
trait Value
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
object DoubleValue

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class Exact[T](t: T)(implicit fractionalT: Fractional[T]) extends BaseNumericFuzzy[T]

Concrete class extending Fuzzy which has zero fuzziness.

Concrete class extending Fuzzy which has zero fuzziness.

Type parameters

T

the underlying type of the value: which must support typeclass Fractional

Value parameters

t

the numerical value

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class BaseNumericFuzzy[T]
trait NumericFuzzy[T]
trait Fuzzy[T]
trait Ordered[Fuzzy[T]]
trait Comparable[Fuzzy[T]]
trait () => T
class Object
trait Matchable
class Any
Show all
object Exact

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
Exact.type

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait FiniteIntegral[N] extends Integral[N]

This trait represents the concept of an integral value defined over a finite range. Real-life examples include Long, Integer, Short, etc.

This trait represents the concept of an integral value defined over a finite range. Real-life examples include Long, Integer, Short, etc.

Created by scalaprof on 1/3/17.

Attributes

Companion
object
Supertypes
trait Integral[N]
trait Numeric[N]
trait Ordering[N]
trait PartialOrdering[N]
trait Equiv[N]
trait Serializable
trait Comparator[N]
class Object
trait Matchable
class Any
Show all
Known subtypes
case class FiniteIntegralException(r: BigInt, c: Class[_]) extends Exception

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

This trait defines the behavior required by Numeric[N]

This trait defines the behavior required by Numeric[N]

Type parameters

N

the underlying integral type, such as Int, Long, BigInt

Attributes

Supertypes
trait FiniteIntegral[N]
trait Integral[N]
trait Numeric[N]
trait Ordering[N]
trait PartialOrdering[N]
trait Equiv[N]
trait Serializable
trait Comparator[N]
class Object
trait Matchable
class Any
Show all
Known subtypes
trait FractionalString[T] extends Fractional[T], FromString[T]

Attributes

Supertypes
trait FromString[T]
trait Fractional[T]
trait Numeric[T]
trait Ordering[T]
trait PartialOrdering[T]
trait Equiv[T]
trait Serializable
trait Comparator[T]
class Object
trait Matchable
class Any
Show all
Known subtypes
trait FromString[T]

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class Fuzziness(value: Option[String])

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Fuzziness

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Fuzziness.type
trait Fuzzy[T] extends () => T, Ordered[Fuzzy[T]]

Typeclass Fuzzy which adds fuzzy behavior to any type.

Typeclass Fuzzy which adds fuzzy behavior to any type.

The method apply() will provide the nominal (i.e. most probable) value

Type parameters

T

the type to which we add the fuzzy behavior

Attributes

Companion
object
Supertypes
trait Ordered[Fuzzy[T]]
trait Comparable[Fuzzy[T]]
trait () => T
class Object
trait Matchable
class Any
Show all
Known subtypes
trait NumericFuzzy[T]
class BaseNumericFuzzy[T]
class Bounded[T]
class Exact[T]
class Gaussian[T]
Show all
object Fuzzy

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Fuzzy.type
case class FuzzyException(w: String) extends Exception

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
trait FuzzyIsFractional[T] extends Fractional[Fuzzy[T]]

Trait which enables Fuzzy[T] to be used in type classes where the context type is a Fractional (or Numeric or Ordering).

Trait which enables Fuzzy[T] to be used in type classes where the context type is a Fractional (or Numeric or Ordering).

Attributes

Supertypes
trait Fractional[Fuzzy[T]]
trait Numeric[Fuzzy[T]]
trait Ordering[Fuzzy[T]]
trait PartialOrdering[Fuzzy[T]]
trait Equiv[Fuzzy[T]]
trait Serializable
trait Comparator[Fuzzy[T]]
class Object
trait Matchable
class Any
Show all
Known subtypes
object FuzzyParser

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class FuzzyParser extends JavaTokenParsers

FuzzyParser is a parser-combinator which parses rules. [Wow, that's a surprise!] Of course, it can also parse any of the constituents of a rule (expression, number, predicate, etc.).

FuzzyParser is a parser-combinator which parses rules. [Wow, that's a surprise!] Of course, it can also parse any of the constituents of a rule (expression, number, predicate, etc.).

A RuleLike is defined as a sealed trait which is extended by several different case classes, each defining a different method of combining rules together into a tree of rules. In general, a leaf rule is a Condition and is made up of two features: a subject and a predicate.

It's important to note that all aspects of these rules are String-based. There is absolutely no conversion to numeric types anywhere in this class.

The trait RuleLike has only one method: asRule which returns a Rule[String]

Created by scalaprof on 5/30/16.

Attributes

Companion
object
Supertypes
trait JavaTokenParsers
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all
case class Gaussian[T](mean: T, sd: T)(using evidence$1: Fractional[T]) extends BaseNumericFuzzy[T]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class BaseNumericFuzzy[T]
trait NumericFuzzy[T]
trait Fuzzy[T]
trait Ordered[Fuzzy[T]]
trait Comparable[Fuzzy[T]]
trait () => T
class Object
trait Matchable
class Any
Show all
case class GenericProbability(p: Double) extends Probability

Probability which is based on a Double

Probability which is based on a Double

Value parameters

p

the probability as a Double

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Probability
trait () => Double
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
object Incrementable

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait Incrementable[X] extends Orderable[X]

Type class Incrementable. An extension of Orderable with the ability to increment the value by integral units and to initialize such a sequence.

Type class Incrementable. An extension of Orderable with the ability to increment the value by integral units and to initialize such a sequence.

This combination of trait Incrementable and implicit objects comprises the "type class" Incrementable.

Attributes

Companion
object
Supertypes
trait Orderable[X]
trait Ordering[X]
trait PartialOrdering[X]
trait Equiv[X]
trait Serializable
trait Comparator[X]
class Object
trait Matchable
class Any
Show all
Known subtypes
object IntAdditionMonoid extends Monoid[Int], Additive[Int]

Attributes

Supertypes
trait Additive[Int]
trait Monoid[Int]
class Object
trait Matchable
class Any
Self type
case class IntScalar(x: Int, source: Any) extends BaseIntScalar

Scalar which is natively an Int. Such a value can be converted to Double by invoking asValuable[Double]

Scalar which is natively an Int. Such a value can be converted to Double by invoking asValuable[Double]

Value parameters

source

the source (which could, conceivably, be a String)

x

the Int value

Attributes

Companion
object
Supertypes
trait Product
trait Equals
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
object IntScalar

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
IntScalar.type
object IntValue

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
IntValue.type
case class IntValue(x: Int, source: Any) extends BaseIntScalar, Value

Value which is natively an Int. Such a value can be converted to Double by invoking asValuable[Double]

Value which is natively an Int. Such a value can be converted to Double by invoking asValuable[Double]

Value parameters

source

the source (which could, conceivably, be a String)

x

the Int value

Attributes

Companion
object
Supertypes
trait Product
trait Equals
trait Value
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
object Monoid

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Monoid.type
trait Monoid[X]

NOTE This is experimental code.

NOTE This is experimental code.

Created by scalaprof on 10/5/16.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait NumericFuzzy[T] extends Fuzzy[T]

Attributes

Supertypes
trait Fuzzy[T]
trait Ordered[Fuzzy[T]]
trait Comparable[Fuzzy[T]]
trait () => T
class Object
trait Matchable
class Any
Show all
Known subtypes
class BaseNumericFuzzy[T]
class Bounded[T]
class Exact[T]
class Gaussian[T]
object Orderable

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Orderable.type
trait Orderable[X] extends Ordering[X]

Type class Orderable.

Type class Orderable.

This combination of trait Orderable and implicit objects comprises the "type class" Orderable.

This has been split off from Valuable by scalaprof on 7/10/16.

CONSIDER extending Ordered instead of Ordering

Attributes

Companion
object
Supertypes
trait Ordering[X]
trait PartialOrdering[X]
trait Equiv[X]
trait Serializable
trait Comparator[X]
class Object
trait Matchable
class Any
Show all
Known subtypes
trait Probability extends () => Double

This trait defines the operations of a Probability

This trait defines the operations of a Probability

Attributes

Companion
object
Supertypes
trait () => Double
class Object
trait Matchable
class Any
Known subtypes
object Probability

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait Product0 extends Any, Product

Created by Bowen Cai on 1/24/2015.

Created by Bowen Cai on 1/24/2015.

Lifted and edited by ScalaProf from http://stackoverflow.com/questions/11305290/is-there-way-to-create-tuple-from-listwithout-codegeneration

Attributes

Supertypes
trait Product
trait Equals
class Any
Known subtypes
object Tuple0

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class QuotedStringScalar(x: String, source: Any) extends BaseQuotedStringScalar

Scalar which is natively a String. Such a value cannot be converted to Int or Double by invoking asValuable.

Scalar which is natively a String. Such a value cannot be converted to Int or Double by invoking asValuable.

Value parameters

source

the source (normally a String but might be enclosed in quotation marks)

x

the String value

Attributes

Companion
object
Supertypes
trait Product
trait Equals
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
case class QuotedStringValue(x: String, source: Any) extends BaseQuotedStringScalar, Value

Value which is natively a String. Such a value cannot be converted to Int or Double by invoking asValuable.

Value which is natively a String. Such a value cannot be converted to Int or Double by invoking asValuable.

Value parameters

source

the source (normally a String but might be enclosed in quotation marks)

x

the String value

Attributes

Companion
object
Supertypes
trait Product
trait Equals
trait Value
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
class Rational[N](numerator: N, denominator: N)(using evidence$1: FiniteIntegral[N]) extends Ordered[Rational[N]]

A simple Rational type for developers not depending on Spire or something like that. This grew out of a class exercise so is not the last word in sophistication.

A simple Rational type for developers not depending on Spire or something like that. This grew out of a class exercise so is not the last word in sophistication.

NOTE that it is not expected that applications will directly reference this case class constructor. If they do, they must ensure that d is positive and that there are no common factors for n and d

NOTE that the underlying type, N, is invariant.

Type parameters

N

the (invariant) underlying integral type

Value parameters

denominator

the denominator of this Rational

numerator

the numerator of this Rational

Attributes

Companion
object
Supertypes
trait Ordered[Rational[N]]
trait Comparable[Rational[N]]
class Object
trait Matchable
class Any
object Rational

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
Rational.type
class RationalException(s: String, x: Exception = ...) extends Exception

Attributes

Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
case class RationalProbability[N](p: Rational[N])(using evidence$1: FiniteIntegral[N]) extends Probability

Probability which is based on a Rational[N]

Probability which is based on a Rational[N]

NOTE that for the | and & methods, we need to convert q into Rational[N]. This is because the unapply method for RationalProbability returns a Rational[Any]

Type parameters

N

the underlying type of Rational[N], with implicit evidence FiniteIntegral[N]

Value parameters

p

the probability as a Rational[N]

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Probability
trait () => Double
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class RationalScalar(x: LongRational, source: Any) extends BaseRationalScalar

Scalar which is natively a Double. Such a value cannot be converted to Int by invoking asValuable[Int] because of loss of precision.

Scalar which is natively a Double. Such a value cannot be converted to Int by invoking asValuable[Int] because of loss of precision.

Value parameters

source

the source (which could, conceivably, be a String)

x

the Double value

Attributes

Companion
object
Supertypes
trait Product
trait Equals
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
case class RationalValue(x: LongRational, source: Any) extends BaseRationalScalar, Value

Value which is natively a Double. Such a value cannot be converted to Int by invoking asValuable[Int] because of loss of precision.

Value which is natively a Double. Such a value cannot be converted to Int by invoking asValuable[Int] because of loss of precision.

Value parameters

source

the source (which could, conceivably, be a String)

x

the Double value

Attributes

Companion
object
Supertypes
trait Product
trait Equals
trait Value
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
object RationalValue

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Appendix to Rational class: only for Scala 2.11

Appendix to Rational class: only for Scala 2.11

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
trait Scalar

Trait Scalar.

Trait Scalar.

The purpose of this trait is to be able to represent quantities -- things that have some ordered (and/or numerical) value -- in a more meaningful way than simply using "Any".

This trait defines six methods: source, asBoolean, asValuable, asOrderable, asIncrementable, asFractional.

For values that you want to consider as numeric, then use asFractional. Valuable is very similar to Numeric/Fractional but has additional methods, in particular fromString, and these methods typically result in a Try[X] as opposed to X.

For values that you want to consider as orderable, then use asOrderable. Orderable extends Ordering. It is used for the type of quantities that do not support arithmetic operations, but do support ordering. A prime example is Date, Datetime, etc.

In the vast majority of cases, you can simply provide a String as the input to Scalar.apply. This is the normal mechanism when you are reading values from HTML, JSON, Config, whatever. Scalars that derive from String representations are normally StringScalars These typically result in an appropriate value when asValuable is invoked, that's to say -- not the String value but the parsed numeric (Valuable) value. If you have a String that you want only to be considered a String, then use QuotedStringScalar

Created by scalaprof on 8/4/16.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Scalar

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Scalar.type
class ScalarException(s: String, t: Throwable = ...) extends Exception

Attributes

Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
trait ScalarMaker extends Any => Try[Scalar]

Attributes

Supertypes
trait Any => Try[Scalar]
class Object
trait Matchable
class Any
case class SeqProduct(elems: Any*) extends Product

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class SequenceValue(xs: Seq[Value], source: Any) extends BaseScalar, Value

Value which is actually a Seq of Values. Such a value, cannot be converted to Int or Double by invoking asValuable, nor by invoking asOrderable. However, when tested by invoking asSequence, such values result in Some(sequence).

Value which is actually a Seq of Values. Such a value, cannot be converted to Int or Double by invoking asValuable, nor by invoking asOrderable. However, when tested by invoking asSequence, such values result in Some(sequence).

Value parameters

source

the source (typically, a Seq of Any objects)

xs

the Seq of Values

Attributes

Companion
object
Supertypes
trait Product
trait Equals
trait Value
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
object SequenceValue

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class StringScalar(x: String, source: Any) extends BaseStringScalar

Scalar which is natively a String. Such a value, providing it is formatted appropriately, can be converted to Int or Double by invoking asValuable[Int] or asValuable[Double], respectively.

Scalar which is natively a String. Such a value, providing it is formatted appropriately, can be converted to Int or Double by invoking asValuable[Int] or asValuable[Double], respectively.

Value parameters

source

the source (normally a String)

x

the String value

Attributes

Companion
object
Supertypes
trait Product
trait Equals
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
object StringScalar

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class StringValue(x: String, source: Any) extends BaseStringScalar, Value

Value which is natively a String. Such a value, providing it is formatted appropriately, can be converted to Int or Double by invoking asValuable[Int] or asValuable[Double], respectively.

Value which is natively a String. Such a value, providing it is formatted appropriately, can be converted to Int or Double by invoking asValuable[Int] or asValuable[Double], respectively.

Value parameters

source

the source (normally a String)

x

the String value

Attributes

Companion
object
Supertypes
trait Product
trait Equals
trait Value
class BaseScalar
trait Serializable
trait Scalar
class Object
trait Matchable
class Any
Show all
object StringValue

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
object Tuple0 extends Product0

Attributes

Supertypes
trait Product0
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
Tuple0.type
object Tuples

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Tuples.type
object Value

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Value.type
sealed trait Value extends Scalar

Trait Value.

Trait Value.

The purpose of this trait is to be able to represent quantities -- things that have some ordered (and/or numerical) value -- (or sequences of quantities) in a more meaningful way than simply using "Any".

This trait defines seven methods: source, asBoolean, asValuable, asOrderable, asIncrementable, asFractional, asSequence.

For values that you want to consider as numeric, then use asFractional. Valuable is very similar to Numeric/Fractional but has additional methods, in particular fromString, and these methods typically result in a Try[X] as opposed to X.

For more detail, see Scalar

You can also represent sequences by Value (in particular, SequenceValue). Such values will yield Some(sequence) when asSequence is invoked. Other types of Value will yield None in this situation.

In the vast majority of cases, you can simply provide a String as the input to Value.apply. This is the normal mechanism when you are reading values from HTML, JSON, Config, whatever. Values that derive from String representations are normally StringValues These typically result in an appropriate value when asValuable is invoked, that's to say -- not the String value but the parsed numeric (Valuable) value. If you have a String that you want only to be considered a String, then use QuotedStringValue

Created by scalaprof on 7/8/16.

Attributes

Companion
object
Supertypes
trait Scalar
class Object
trait Matchable
class Any
Known subtypes
class BooleanValue
class DateValue
class DoubleValue
class IntValue
class StringValue
Show all
class ValueException(s: String, t: Throwable = ...) extends Exception

Attributes

Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
trait ValueMaker extends Any => Try[Value]

Attributes

Supertypes
trait Any => Try[Value]
class Object
trait Matchable
class Any

Types

type LongRational = Rational[Long]