cc.factorie.util

Cubbie

class Cubbie extends AnyRef

A Cubbie provides typed access to an underlying Map data-structure. This map can come from various sources, such as JSON objects or MongoDB objects.

Cubbies are designed to make access to (often persistent) data safe, easy and generic. This comes at the price of efficiency, so clients should not access Cubbies in inner-loops of computations. In practice this may require a further conversion step from Cubbies into a more efficient representation.

Self Type
Cubbie
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Cubbie
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Cubbie(map: Map[String, Any])

    Constructor that takes the underlying map.

    Constructor that takes the underlying map.

    map

    the underlying map to use.

  2. new Cubbie()

Type Members

  1. sealed trait AbstractInverseSlot[+A <: Cubbie] extends AnyRef

    An AbstractInverseSlot is a slot that contains a collection of other cubbies, namely the ones that have the given target value as value of the given foreign slot.

  2. trait AbstractRefSlot[+A <: Cubbie] extends AbstractSlot[Any]

    A helper trait for libraries that need ref slots to be covariant.

  3. trait AbstractSlot[+T] extends AnyRef

    A Cubbie has a collection of slots (or fields) that store the attributes of the cubbie.

  4. case class AnySlot[A](name: String) extends PrimitiveSlot[A] with Product with Serializable

    This allows any type to be stored in a slot.

  5. case class BooleanListSlot(name: String) extends PrimitiveListSlot[Boolean] with Product with Serializable

  6. case class BooleanSlot(name: String) extends PrimitiveSlot[Boolean] with Product with Serializable

  7. case class CubbieListSlot[A <: Cubbie](name: String, constructor: () ⇒ A) extends Slot[Seq[A]] with Product with Serializable

    A slot that contains a list of cubbies.

  8. case class CubbieSlot[A <: Cubbie](name: String, constructor: () ⇒ A) extends Slot[A] with Product with Serializable

    A slot that contains a cubbie.

  9. case class DateSlot(name: String) extends PrimitiveSlot[Date] with Product with Serializable

  10. case class DoubleListSlot(name: String) extends PrimitiveListSlot[Double] with Product with Serializable

  11. case class DoubleSlot(name: String) extends PrimitiveSlot[Double] with Product with Serializable

  12. case class IntListSlot(name: String) extends PrimitiveListSlot[Int] with Product with Serializable

  13. case class IntSlot(name: String) extends PrimitiveSlot[Int] with Product with Serializable

  14. case class InverseSlot[A <: Cubbie](name: String, slot: (A) ⇒ A.AbstractRefSlot[Cubbie])(implicit m: Manifest[A]) extends AbstractInverseSlot[A] with Product with Serializable

    The Inverse slot is a default implementation of the AbstractInverseSlot.

  15. type MapType = Map[String, Any]

    The type of underlying Map.

    The type of underlying Map. We use the generic scala mutable Map interface. If clients want to use their own Map data structure (such as MongoDB maps) they only need to provide a wrapper mutable.Map implementation around their data.

  16. trait PrimitiveListSlot[A] extends Slot[Seq[A]]

    A slot containing a list of primitives.

  17. trait PrimitiveSlot[T] extends Slot[T]

    A slot containing primitive values (ints, strings, booleans etc.

  18. case class RefSlot[A <: Cubbie](name: String, constructor: () ⇒ A) extends Slot[Any] with AbstractRefSlot[A] with AbstractInverseSlot[A] with Product with Serializable

    A RefSlot is a simple type of AbstractInverseSlot which "contains" all cubbies of a given type with the given ID.

  19. trait Slot[T] extends AbstractSlot[T]

    Default implementation of an AbstractSlot.

  20. case class StringListSlot(name: String) extends PrimitiveListSlot[String] with Product with Serializable

  21. case class StringSlot(name: String) extends PrimitiveSlot[String] with Product with Serializable

  22. case class TensorListSlot(name: String) extends PrimitiveListSlot[Tensor] with Product with Serializable

  23. case class TensorSlot(name: String) extends PrimitiveSlot[Tensor] with Product with Serializable

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. object Id extends AbstractSlot[Any]

    Every cubbie has an ID.

  7. def _map: MapType

    Returns underlying map.

    Returns underlying map. todo: remove this

    returns

    the current underlying map. If empty, a new map is created and set.

  8. def _map_=(map: Map[String, Any]): Unit

    Alternative method to set underyling map.

    Alternative method to set underyling map. todo: remove this.

    map

    the underlying map.

  9. def _newDefaultMap: MapType

    Creates a default map.

    Creates a default map.

    returns

    a default map to be used as underyling map.

  10. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  11. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def cubbieClass: Class[Cubbie]

    Typed access to the cubbie class.

    Typed access to the cubbie class.

    returns

    the Cubbie class.

  13. def cubbieName: String

  14. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  19. final def id: Any

    Returns the ID of the cubbie.

    Returns the ID of the cubbie. Creates a new ID if no ID has yet been set.

    returns

    an identifier for this cubbie.

  20. def idName: String

    The map key to use for the ID field.

    The map key to use for the ID field.

    returns

    the key to use for the id field.

  21. def id_=(i: Any): Unit

    Set an id for this cubbie.

    Set an id for this cubbie.

    i

    an ID. Generally can be any type of object, but during serialization some types may not be storable by the underyling serialization framework.

  22. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  23. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  24. def newId: Long

    Create a new random ID.

    Create a new random ID.

    returns

    random ID.

  25. final def notify(): Unit

    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  27. def setMap(map: MapType): Cubbie.this.type

    Set the underlying map for this cubbie.

    Set the underlying map for this cubbie.

    map

    the map that will be used as underlying datastructure

    returns

    this cubbie.

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

    Definition Classes
    AnyRef
  29. def toString(): String

    Prints out the underlying map

    Prints out the underlying map

    returns

    a string representation of the underyling map.

    Definition Classes
    Cubbie → AnyRef → Any
  30. def version: String

  31. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped