Object/Trait

org.dianahep.histogrammar

Factory

Related Docs: trait Factory | package histogrammar

Permalink

object Factory

Entry point for constructing containers from JSON and centralized registry of container types.

Containers filled in Python or on remote sites are serialized as JSON that the Factory object can reconstruct. Reconstructed containers are fixed (immutable, cannot aggregate), but can be merged with the + operator. (Click on the "o" in a circle in the upper-left to see the Factory trait's documentation, which explains the difference.)

To do this, the Factory object must dispatch JSON to the appropriate container for interpretation. It therefore manages a global registry of container types (concrete instances of the Factory trait). General users are not expected to add to this registry, but they could if they want to.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Factory
  2. AnyRef
  3. 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. def apply(name: String): Factory

    Permalink

    Get a registered container by its name.

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def fromJson(json: Json): Container[_] with NoAggregation

    Permalink

    User's entry point for reconstructing a container from a JSON object.

    User's entry point for reconstructing a container from a JSON object.

    The container's type is not known at compile-time, so it must be cast (with the container's as method) or pattern-matched (with the corresponding Factory).

  11. def fromJsonFile(file: File): Container[_] with NoAggregation

    Permalink

    User's entry point for reading a container as JSON from a UTF-8 encoded file.

    User's entry point for reading a container as JSON from a UTF-8 encoded file.

    The container's type is not known at compile-time, so it must be cast (with the container's as method) or pattern-matched (with the corresponding Factory).

  12. def fromJsonFile(fileName: String): Container[_] with NoAggregation

    Permalink

    User's entry point for reading a container as JSON from a UTF-8 encoded file.

    User's entry point for reading a container as JSON from a UTF-8 encoded file.

    The container's type is not known at compile-time, so it must be cast (with the container's as method) or pattern-matched (with the corresponding Factory).

  13. def fromJsonStream(inputStream: InputStream): Container[_] with NoAggregation

    Permalink

    User's entry point for reading a container as JSON from a UTF-8 encoded file.

    User's entry point for reading a container as JSON from a UTF-8 encoded file.

    Note: fully consumes the inputStream.

    The container's type is not known at compile-time, so it must be cast (with the container's as method) or pattern-matched (with the corresponding Factory).

  14. def fromJsonString(str: String): Container[_] with NoAggregation

    Permalink

    User's entry point for reconstructing a container from JSON text.

    User's entry point for reconstructing a container from JSON text.

    The container's type is not known at compile-time, so it must be cast (with the container's as method) or pattern-matched (with the corresponding Factory).

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

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

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

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

    Permalink
    Definition Classes
    AnyRef
  21. def register(factory: Factory): Unit

    Permalink

    Add a new Factory to the registry, introducing a new container type on the fly.

    Add a new Factory to the registry, introducing a new container type on the fly. General users usually wouldn't do this, but they could. This method is used internally to define the standard container types.

  22. def registered: ListMap[String, Factory]

    Permalink

    Get a list of registered containers as a Map from factory name to Factory object.

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

    Permalink
    Definition Classes
    AnyRef
  24. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped