t
scalqa

Util.Void

trait _Trait extends AnyRef

Scalqa/Stream supports a concept of "void object" ("empty object"), which can be defined for any type. This is similar to 'Null Object Pattern'

Unlike 'null', void object can have methods invoked, getting some behavior pertinent to 'voidness'

Examples:

  • Void Stream.Interface is a singleton object of empty stream, which can be re-used for any type
  • Void Opt, is a singleton optional value with no value, which can be re-used for any type
  • Void String, is a string of zero length, which can be re-used for String type instead of null

Void objects have standard way to declare their voidness mixing this trait. Alternatively, Util.Able.Void trait can be mixed and isVoid test added explicitly

Types with void values have to define implicit conversions from Util.Void.Request, aka \/

class Foo

object Foo{
  val Void = new Foo with Void

  implicit def zzMake(v: \/) = Void
}

var v: Foo = \/   // Standard void assignment

A standard way to test for voidness is Util.Void.is method

Ordering
  1. Alphabetic
Inherited
  1. Void
  2. scala.AnyRef
  3. scala.Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Method

  1. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  2. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  3. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  4. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  6. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  7. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  8. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. final def notify(): Unit
    Definition Classes
    AnyRef
  10. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  11. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  12. def toString(): String
    Definition Classes
    AnyRef → Any
  13. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Operator

  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
Linear Supertypes
AnyRef, Any
Known Subclasses
Source: _Trait.scala