Object/Class

ml.combust.bundle.dsl

Value

Related Docs: class Value | package dsl

Permalink

object Value extends Serializable

Provides a set of helper methods for easily creating ml.combust.bundle.dsl.Value objects.

Easily create ml.combust.bundle.dsl.Value objects of any type using the helper methods provided here. The helper methods will wrap a Scala value for later serializing into Bundle.ML.

Also provides several helper methods for converting from Bundle.ML protobuf objects back into wrapped Scala objects.

Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Value
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def basicDataType(basic: BasicType): DataType

    Permalink

    Create a basic data type.

    Create a basic data type.

    Basic data types are string, long, double, boolean.

    basic

    string, long, double, or boolean

    returns

    data type for the basic type

  6. def boolean(value: Boolean): Value

    Permalink

    Create a boolean value.

    Create a boolean value.

    value

    value to wrap

    returns

    wrapped value

  7. val booleanDataType: DataType

    Permalink
  8. def booleanList(value: Seq[Boolean]): Value

    Permalink

    Create a list of booleans value.

    Create a list of booleans value.

    value

    Scala boolean list

    returns

    wrapped value

  9. val booleanListDataType: DataType

    Permalink
  10. def bundleValue(dataType: DataType, value: Any)(implicit hr: HasBundleRegistry): bundle.Value.Value

    Permalink

    Converts a Scala value to a protobuf value.

    Converts a Scala value to a protobuf value.

    dataType

    type of Scala value

    value

    Scala value to convert

    hr

    bundle registry for custom types

    returns

    protobuf value of the Scala value

  11. def byte(value: Byte): Value

    Permalink

    Create a byte value.

    Create a byte value.

    value

    value to wrap

    returns

    wrapped value

  12. val byteDataType: DataType

    Permalink
  13. def byteList(value: Seq[Byte]): Value

    Permalink

    Create a list of byte value.

    Create a list of byte value.

    value

    Scala byte list

    returns

    wrapped value

  14. val byteListDataType: DataType

    Permalink
  15. def byteString(bs: ByteString): Value

    Permalink

    Create a byte string value.

    Create a byte string value.

    bs

    byte string

    returns

    value with byte string

  16. val byteStringDataType: DataType

    Permalink
  17. def byteStringList(bss: Seq[ByteString]): Value

    Permalink

    Create a list of byte string.

    Create a list of byte string.

    bss

    data types

    returns

    value with data types

  18. val byteStringListDataType: DataType

    Permalink
  19. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. def custom[T](value: T)(implicit arg0: ClassTag[T], hr: HasBundleRegistry): Value

    Permalink

    Create a custom value.

    Create a custom value.

    T

    Scala class of the custom value

    value

    value to wrap

    hr

    bundle registry for custom value serializer

    returns

    wrapped custom value

  21. def customDataType[T](implicit arg0: ClassTag[T], hr: HasBundleRegistry): DataType

    Permalink

    Create a custom data type.

    Create a custom data type.

    Custom data types are used to store arbitrary Scala objects.

    T

    Scala class of the custom value

    hr

    bundle registry for custom value serializer

    returns

    data type for the custom value

  22. def customList[T](value: Seq[T])(implicit arg0: ClassTag[T], hr: HasBundleRegistry): Value

    Permalink

    Create a list of custom objects value.

    Create a list of custom objects value.

    T

    Scala class of the custom values

    value

    Scala list of custom objects

    hr

    bundle registry for constructing custom data type

    returns

    wrapped custom list

  23. def customListN[T](n: Int, value: Seq[_])(implicit arg0: ClassTag[T], hr: HasBundleRegistry): Value

    Permalink

    Construct a nested list of custom values.

    Construct a nested list of custom values.

    See Value.listN for example usage.

    T

    Scala class of the custom data

    n

    depth of nesting

    value

    Scala nested list of custom objects

    hr

    bundle registry needed for custom data type

    returns

    wrapped nested list of custom values

  24. def dataType(dt: DataType): Value

    Permalink

    Create a data type value.

    Create a data type value.

    dt

    data type to store

    returns

    value with data type

  25. val dataTypeDataType: DataType

    Permalink
  26. def dataTypeList(dts: Seq[DataType]): Value

    Permalink

    Create a list of data types.

    Create a list of data types.

    dts

    data types

    returns

    value with data types

  27. def double(value: Double): Value

    Permalink

    Create a double value.

    Create a double value.

    value

    value to wrap

    returns

    wrapped value

  28. val doubleDataType: DataType

    Permalink
  29. def doubleList(value: Seq[Double]): Value

    Permalink

    Create a list of doubles value.

    Create a list of doubles value.

    value

    Scala double list

    returns

    wrapped value

  30. val doubleListDataType: DataType

    Permalink
  31. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  34. def float(value: Float): Value

    Permalink

    Create a float value.

    Create a float value.

    value

    value to wrap

    returns

    wrapped value

  35. val floatDataType: DataType

    Permalink
  36. def floatList(value: Seq[Float]): Value

    Permalink

    Create a list of float value.

    Create a list of float value.

    value

    Scala float list

    returns

    wrapped value

  37. val floatListDataType: DataType

    Permalink
  38. def fromBundle(dataType: DataType, value: bundle.Value.Value)(implicit hr: HasBundleRegistry): Value

    Permalink

    Convert a ml.bundle.Value.Value into a ml.combust.bundle.dsl.Value.

    dataType

    data type of the protobuf value

    value

    protobuf value to convert

    hr

    bundle registry for custom types

    returns

    wrapped Scala value of protobuf object

  39. def fromListValue(lt: ListType, list: ListValue)(implicit hr: HasBundleRegistry): Any

    Permalink

    Convert a ml.bundle.Value.Value.ListValue into a Scala Seq.

    Convert a ml.bundle.Value.Value.ListValue into a Scala Seq.

    Lists can be of any depth, and so can be decoded to Seq[Seq[Seq[String\]\]\] for example.

    lt

    list type to extract to a Scala value

    list

    protobuf list to extract to Scala value

    hr

    bundle registry for custom types

    returns

    Scala value of protobuf object

  40. def fromTensorValue(tt: TensorType, tensor: Tensor): Tensor[_]

    Permalink

    Convert from a ml.bundle.Tensor.Tensor to a ml.combust.mleap.tensor.Tensor.

    Convert from a ml.bundle.Tensor.Tensor to a ml.combust.mleap.tensor.Tensor.

    tt

    bundle type of tensor

    tensor

    bundle tensor

    returns

    mleap tensor

  41. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    AnyRef → Any
  43. def int(value: Int): Value

    Permalink

    Create an int value.

    Create an int value.

    value

    value to wrap

    returns

    wrapped value

  44. val intDataType: DataType

    Permalink
  45. def intList(value: Seq[Int]): Value

    Permalink

    Create a list of int value.

    Create a list of int value.

    value

    Scala int list

    returns

    wrapped value

  46. val intListDataType: DataType

    Permalink
  47. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  48. def listDataType(base: DataType): DataType

    Permalink

    Create a list data type.

    Create a list data type.

    Use ml.combust.bundle.dsl.Value.listDataTypeN for nested lists.

    base

    type of values held within list

    returns

    list data type for the base type

  49. val listDataTypeDataType: DataType

    Permalink
  50. def listDataTypeN(base: DataType, n: Int): DataType

    Permalink

    Create a nested list data type of any depth.

    Create a nested list data type of any depth.

    To represent a Seq[Seq[Seq[Long\]\]\] from Scala, pass in a longDataType for base and n = 3.

    base

    data type of the nested list

    n

    depth of the nested list

    returns

    data type for a nested list

  51. def listN(base: DataType, n: Int, value: Seq[_]): Value

    Permalink

    Construct a nested list of any value.

    Construct a nested list of any value.

    For custom values use Value.customListN Example to construct a nested list of Double.

    scala> import ml.bundle.BasicType.BasicType
           import ml.bundle.dsl._
           val list: Seq[Seq[Seq[Double]]] = Seq(Seq(
             Seq(45.6, 77.8, 34.5),
             Seq(2.3, 5.6, 44.5)
           ))
    scala> val value = Value.listN(Value.doubleDataType, 3, list)
    value: ml.bundle.dsl.Value = Value(DataType(List(ListType(DataType(List(ListType(DataType(List(ListType(DataType(Basic(DOUBLE))))))))))),List(List(List(45.6, 77.8, 34.5), List(2.3, 5.6, 44.5))))
    base

    data type of the list

    n

    depth of the nested list

    value

    Scala nested list with base values in it

    returns

    wrapped nested list

  52. def listValue(lt: ListType, value: Seq[_])(implicit hr: HasBundleRegistry): ListValue

    Permalink

    Create a list value.

    Create a list value.

    value can be a nested list, as long as lt is also nested. For example, lt can be a list of list of double then value should be a Seq[Seq[Double]].

    lt

    list type

    value

    Scala list

    hr

    bundle registry for custom types

    returns

    list protobuf object of the Scala list

  53. def long(value: Long): Value

    Permalink

    Create a long value.

    Create a long value.

    value

    value to wrap

    returns

    wrapped value

  54. val longDataType: DataType

    Permalink
  55. def longList(value: Seq[Long]): Value

    Permalink

    Create a list of longs value.

    Create a list of longs value.

    value

    Scala long list

    returns

    wrapped value

  56. val longListDataType: DataType

    Permalink
  57. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  60. def short(value: Short): Value

    Permalink

    Create a short value.

    Create a short value.

    value

    value to wrap

    returns

    wrapped value

  61. val shortDataType: DataType

    Permalink
  62. def shortList(value: Seq[Short]): Value

    Permalink

    Create a list of short value.

    Create a list of short value.

    value

    Scala long list

    returns

    wrapped value

  63. val shortListDataType: DataType

    Permalink
  64. def string(value: String): Value

    Permalink

    Create a string value.

    Create a string value.

    value

    value to wrap

    returns

    wrapped value

  65. val stringDataType: DataType

    Permalink
  66. def stringList(value: Seq[String]): Value

    Permalink

    Create a list of strings value.

    Create a list of strings value.

    value

    Scala string list

    returns

    wrapped value

  67. val stringListDataType: DataType

    Permalink
  68. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  69. def tensor[T](tensor: Tensor[T]): Value

    Permalink

    Create a tensor value.

    Create a tensor value.

    Dimensions must have size greater than 0. Use -1 for dimensions that can be any size.

    tensor

    tensor value

    returns

    tensor value

  70. def tensorDataType(basic: BasicType): DataType

    Permalink

    Create a tensor data type.

    Create a tensor data type.

    basic

    basic data type of the tensor

    returns

    tensor data type

  71. def tensorList[T](tensors: Seq[Tensor[T]])(implicit arg0: ClassTag[T]): Value

    Permalink

    Create a list of tensors.

    Create a list of tensors.

    Dimensions of a tensor indicate how many values are in each dimension. Each dimension must be a positive integer. Use -1 if the dimension can have any number of values in it.

    tensors

    tensors in the list

    returns

    wrapped list of tensors

  72. def tensorValue(tensor: Tensor[_]): Tensor

    Permalink

    Convert ml.combust.mleap.tensor.Tensor to ml.bundle.Tensor.Tensor.

    Convert ml.combust.mleap.tensor.Tensor to ml.bundle.Tensor.Tensor.

    tensor

    mleap tensor

    returns

    bundle tensor

  73. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  74. def vector[T](values: Array[T])(implicit arg0: ClassTag[T]): Value

    Permalink

    Create a tensor value with 1 dimension.

    Create a tensor value with 1 dimension.

    T

    type of vector

    values

    values of vector

    returns

    tensor with vector

  75. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped