Class/Object

com.phasmidsoftware.args

Arg

Related Docs: object Arg | package args

Permalink

case class Arg[X](name: Option[String], value: Option[X]) extends Ordered[Arg[X]] with Product with Serializable

Case class to represent an "option" in a command line. Such an option has an (optional) name which is a String; and an (optional) value, which is of type X.

X

the underlying type of the value.

name

the optional name.

value

the optional value.

Linear Supertypes
Serializable, Serializable, Product, Equals, Ordered[Arg[X]], Comparable[Arg[X]], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Arg
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Ordered
  7. Comparable
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Arg(name: Option[String], value: Option[X])

    Permalink

    name

    the optional name.

    value

    the optional value.

Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. def <(that: Arg[X]): Boolean

    Permalink
    Definition Classes
    Ordered
  4. def <=(that: Arg[X]): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  6. def >(that: Arg[X]): Boolean

    Permalink
    Definition Classes
    Ordered
  7. def >=(that: Arg[X]): Boolean

    Permalink
    Definition Classes
    Ordered
  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def asOption: Option[(String, Option[X])]

    Permalink

    Method to return this Arg as an optional tuple of a String and an optional X value, according to whether it's an "option".

    Method to return this Arg as an optional tuple of a String and an optional X value, according to whether it's an "option".

    returns

    Some[(String, Option[X]) if name is not None otherwise None.

  10. def byName(w: String): Option[Arg[X]]

    Permalink

    Method to get this Arg, if and only if its name matches the given String (w)

    Method to get this Arg, if and only if its name matches the given String (w)

    w

    the string to match.

    returns

    either Some(this) or else None.

  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def compare(that: Arg[X]): Int

    Permalink

    Method to compare this Arg with that.

    Method to compare this Arg with that.

    TEST this method.

    that

    the Arg to compare with.

    returns

    the result of invoking x compare y where x and y are the values of this and that Args.

    Definition Classes
    Arg → Ordered
  13. def compareTo(that: Arg[X]): Int

    Permalink
    Definition Classes
    Ordered → Comparable
  14. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. def finalize(): Unit

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

    Permalink
    Definition Classes
    AnyRef → Any
  17. def hasValue: Boolean

    Permalink

    Method to determine if this Arg has a value, thus either an option with value, or an operand.

    Method to determine if this Arg has a value, thus either an option with value, or an operand.

    returns

    true if value is not None

  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. def isOption: Boolean

    Permalink

    Method to determine if this Arg is an option (also known as a "flag"), as opposed to an operand.

    Method to determine if this Arg is an option (also known as a "flag"), as opposed to an operand.

    returns

    true if name is not None

  20. def isOptional(s: Synopsis): Maybe

    Permalink

    Method to determine if this Arg is optional according to the synopsis provided.

    Method to determine if this Arg is optional according to the synopsis provided.

    s

    the synopsis.

    returns

    Kleenean(true if this Arg is optional.

  21. def map[Y](f: (X) ⇒ Y): Arg[Y]

    Permalink

    Method to map this Arg into an Arg of underlying type Y

    Method to map this Arg into an Arg of underlying type Y

    Y

    the underlying type of the result.

    f

    a function to convert an X into a Y.

    returns

    an Arg[Y]

  22. val name: Option[String]

    Permalink

    the optional name.

  23. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  26. def operand: Option[X]

    Permalink

    Method to return this Arg as an optional X value, according to whether it's an "operand".

    Method to return this Arg as an optional X value, according to whether it's an "operand".

    returns

    Some[X] if name is None otherwise None.

  27. def process(fm: Map[String, (Option[X]) ⇒ Unit]): Try[Option[X]]

    Permalink

    Method to process this Arg, given a map of options and their corresponding functions.

    Method to process this Arg, given a map of options and their corresponding functions.

    fm

    a Map of String->function where function is of type Option[X]=>Unit

    returns

    a Success[None] if there was a function defined for this Arg in the map fm AND if the function invocation was successful; otherwise a Failure[X]

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

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

    Permalink

    Method to form a String from this Arg

    Method to form a String from this Arg

    returns

    "Arg: flag name/anonymous with value: value/none"

    Definition Classes
    Arg → AnyRef → Any
  30. def toY[Y](implicit arg0: Derivable[Y]): Try[Y]

    Permalink

    Method to get the value of this Arg as a Y.

    Method to get the value of this Arg as a Y.

    Y

    the type of the result.

    returns

    the result of deriving a Y value from the actual value of this Arg, wrapped in Try.

  31. val value: Option[X]

    Permalink

    the optional value.

  32. final def wait(): Unit

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

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

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

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Ordered[Arg[X]]

Inherited from Comparable[Arg[X]]

Inherited from AnyRef

Inherited from Any

Ungrouped