cc.factorie.util.Cubbie

RefSlot

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. Assuming uniqueness of IDs, it's a unique inverse slot.

The RefSlot field only stores the actual ID of the referenced cubbie. This means that calling value or apply() on this slot returns (untyped) ids. Likewise, the setter methods only take ids. Convenience methods exist to pass in cubbies instead.

A

the type of cubbies this slot contains.

name

the name of the slot.

constructor

the cubbie constructor for cubbies the slot contains.

Linear Supertypes
Serializable, Serializable, Product, Equals, AbstractInverseSlot[A], AbstractRefSlot[A], Slot[Any], AbstractSlot[Any], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RefSlot
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AbstractInverseSlot
  7. AbstractRefSlot
  8. Slot
  9. AbstractSlot
  10. AnyRef
  11. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RefSlot(name: String, constructor: () ⇒ A)

    name

    the name of the slot.

    constructor

    the cubbie constructor for cubbies the slot contains.

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. def ::=(value: A): Unit

  5. def :=(ref: Any): Unit

    Set the value for this slot.

    Set the value for this slot.

    Definition Classes
    RefSlotSlot
  6. def :=(opt: Option[Any]): Unit

    Set the value of this slot using an option.

    Set the value of this slot using an option. If parameter is Some(value) the value is set, if None nothing is changed.

    opt

    the option to use.

    Definition Classes
    Slot
  7. def :=!(value: Any)(implicit preHook: (AbstractSlot[Any], Any) ⇒ Unit): Unit

    Set a value for this slot but inform the provided hook before this happens.

    Set a value for this slot but inform the provided hook before this happens.

    value

    the value to set.

    preHook

    the hook to call before setting the value.

    Definition Classes
    Slot
  8. final def ==(arg0: AnyRef): Boolean

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

    Definition Classes
    Any
  10. def apply(value: Any): Cubbie.this.type

    Set the value and return the containing Cubbie.

    Set the value and return the containing Cubbie.

    value

    the value to set.

    returns

    the cubbie this slot belongs to.

    Definition Classes
    Slot
  11. def apply(): Any

    Convenience method for more concise access to slot value.

    Convenience method for more concise access to slot value.

    returns

    value of the slot.

    Definition Classes
    AbstractSlot
  12. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  13. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. val constructor: () ⇒ A

    the cubbie constructor for cubbies the slot contains.

  15. def cubbie: Cubbie.this.type

    The cubbie this slot is contained in.

    The cubbie this slot is contained in.

    returns

    this cubbie.

    Definition Classes
    AbstractSlot
  16. def deref(implicit tr: Map[Any, Cubbie]): A

    The value of a RefSlot is the id of the referenced cubbie.

    The value of a RefSlot is the id of the referenced cubbie. To get an actual cubbie, clients need to call this method. It takes as implicit parameter a mapping from ids to cubbies. This is a deliberate choice: the slot itself is not supposed to store any internal state/mapping to cubbies, it only stores the id.

    tr

    mapping from ids to cubbies.

    returns

    the object associated with the given id in the given mapping.

    Definition Classes
    AbstractRefSlot
  17. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def foreignSlot: (Cubbie) ⇒ Id

    The slot of the cubbies that needs to have a particular target value for the cubbie to be in this slot.

    The slot of the cubbies that needs to have a particular target value for the cubbie to be in this slot.

    returns

    the foreign slot.

    Definition Classes
    RefSlotAbstractInverseSlot
  20. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  21. def isDefined: Boolean

    Does the cubbie have this slot.

    Does the cubbie have this slot.

    returns

    true iff the underyling map has this slot.

    Definition Classes
    Slot
  22. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  23. val name: String

    the name of the slot.

    the name of the slot.

    Definition Classes
    RefSlotAbstractInverseSlotSlotAbstractSlot
  24. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  25. final def notify(): Unit

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

    Definition Classes
    AnyRef
  27. def opt: Option[Any]

    Returns Some(value) if the cubbie has the given slot, or None otherwise.

    Returns Some(value) if the cubbie has the given slot, or None otherwise.

    returns

    Some(value) if the cubbie has the given slot, or None otherwise.

    Definition Classes
    SlotAbstractSlot
  28. def rawPut(value: Any): Unit

    Set a raw value into the underlying map.

    Set a raw value into the underlying map. Should generally only be used in other library code.

    value

    the value to be set.

    Definition Classes
    Slot
  29. def set(opt: Option[Any]): Cubbie.this.type

    Set the value of this slot using an option.

    Set the value of this slot using an option. If parameter is Some(value) the value is set, if None nothing is changed. Returns this cubbie.

    opt

    the option to use.

    returns

    the encompassing cubbie.

    Definition Classes
    Slot
  30. def set(value: Any): Cubbie.this.type

    Set value of slot and return this Cubbie.

    Set value of slot and return this Cubbie.

    value

    value to set.

    returns

    this cubbie.

    Definition Classes
    Slot
  31. def slot: (A) ⇒ slot.$anonfun.a.type.Id.type forSome {val a: A}

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

    Definition Classes
    AnyRef
  33. def target: Option[Any]

    What value does the foreign slot should have.

    What value does the foreign slot should have.

    returns

    Some(target-value) or None if this cubbie has no values in this slot.

    Definition Classes
    RefSlotAbstractInverseSlot
  34. def toString(): String

    Definition Classes
    Slot → AnyRef → Any
  35. def unique: Boolean

    Can there be several cubbies with the target value?

    Can there be several cubbies with the target value?

    returns

    true iff there can be several cubbies with the given target value.

    Definition Classes
    RefSlotAbstractInverseSlot
  36. def value: Any

    The current value of the slot.

    The current value of the slot.

    returns

    the value of slot. May throw an exception if the underlying map has no field corresponding to this slot.

    Definition Classes
    RefSlotSlotAbstractSlot
  37. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AbstractInverseSlot[A]

Inherited from AbstractRefSlot[A]

Inherited from Slot[Any]

Inherited from AbstractSlot[Any]

Inherited from AnyRef

Inherited from Any

Ungrouped