scalax.io

ReadCharsResource

trait ReadCharsResource [+R] extends Resource[R] with ReadChars with ResourceOps[R, ReadCharsResource[R]]

An object that in addition to being a resource is also a ReadChars Resource.

R

The underlying resource

Since

1.0

Linear Supertypes
ReadChars, Resource[R], ResourceOps[R, ReadCharsResource[R]], ManagedResourceOperations[R], ManagedResource[R], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. ReadCharsResource
  2. ReadChars
  3. Resource
  4. ResourceOps
  5. ManagedResourceOperations
  6. ManagedResource
  7. AnyRef
  8. Any
Visibility
  1. Public
  2. All

Abstract Value Members

  1. def addCloseAction (newCloseAction: CloseAction[R]): ReadCharsResource[R]

    Add a CloseAction that will be executed each time the resource is closed.

    Add a CloseAction that will be executed each time the resource is closed.

    newCloseAction

    the action to add

    returns

    a new resource instance with the close action added

    Attributes
    abstract
    Definition Classes
    ResourceOps
  2. def chars : LongTraversable[Char]

    The characters in the object.

    The characters in the object.

    @return an traversable of all the characters

    Attributes
    abstract
    Definition Classes
    ReadChars
  3. def context : ResourceContext

    Get the Resource context that configures how the underlying resource is accessed

    Get the Resource context that configures how the underlying resource is accessed

    returns

    the associated ResourceContext

    Attributes
    abstract
    Definition Classes
    ReadChars
  4. def open (): OpenedResource[R]

    Creates a new instance of the underlying resource (or opens it).

    Creates a new instance of the underlying resource (or opens it). Sometimes the code block used to create the Resource is non-reusable in which case this Resource can only be used once. This is not recommended.

    When creating a resource it is recommended to pass the code block for creating the resource to the resource so that the resource can be reused. Of course this is not always possible

    This method should only be used with care in cases when Automatic Resource Management cannot be used because the InputStream must be closed manually.

    This is public only to permit interoperability with certain Java APIs. A better pattern of use should be:

    resource.acquireFor {
      // call java API
    }
    

    or

    val calculatedResult = resource.acquireAndGet {
      // cal java API that returns a result
    }
    
    returns

    the actual resource that has been opened

    Attributes
    abstract
    Definition Classes
    Resource
  5. def updateContext (newContext: ResourceContext): ReadCharsResource[R]

    Create a Resource instance that is configured with the new ResourceContext

    Create a Resource instance that is configured with the new ResourceContext

    newContext

    A new ResourceContext

    returns

    a new instance configured with the new context

    Attributes
    abstract
    Definition Classes
    ResourceOps

Concrete Value Members

  1. def ! : R @scala.util.continuations.cpsParam[Unit,Unit]

    Definition Classes
    ManagedResourceOperations → ManagedResource
  2. def != (arg0: AnyRef): Boolean

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

    Attributes
    final
    Definition Classes
    Any
  4. def ## (): Int

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

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

    Attributes
    final
    Definition Classes
    Any
  7. def acquireAndGet [B] (f: (R) ⇒ B): B

    Definition Classes
    ManagedResourceOperations → ManagedResource
  8. def acquireFor [B] (f: (R) ⇒ B): Either[List[Throwable], B]

    Open the resource execute the function and either return all errors as a list or the result of the function execution.

    Open the resource execute the function and either return all errors as a list or the result of the function execution.

    On open and close error handlers in ResourceContext are called. If they then raise errors the errors are captured and returned as a Right[List[Throwable]]

    Perhaps the worst method I have ever written :-(

    Attributes
    final
    Definition Classes
    Resource → ManagedResource
  9. def and [B] (that: ManagedResource[B]): ManagedResource[(R, B)]

    Definition Classes
    ManagedResourceOperations → ManagedResource
  10. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  11. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  12. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  13. def equals (arg0: Any): Boolean

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

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  15. def flatMap [B] (f: (R) ⇒ ManagedResource[B]): ManagedResource[B]

    Definition Classes
    ManagedResourceOperations → ManagedResource
  16. def foreach (f: (R) ⇒ Unit): Unit

    Definition Classes
    ManagedResourceOperations → ManagedResource
  17. def getClass (): java.lang.Class[_]

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

    Definition Classes
    AnyRef → Any
  19. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  20. def lines (terminator: Terminator = Terminators.Auto, includeTerminator: Boolean = false): LongTraversable[String]

    Obtain an non-strict traversable for iterating through the lines in the object

    Obtain an non-strict traversable for iterating through the lines in the object

    terminator

    The strategy for determining the end of line Default is to auto-detect the EOL

    includeTerminator

    if true then the line will end with the line terminator Default is false

    @return a non-strict traversable for iterating through all the lines

    Definition Classes
    ReadChars
  21. def map [B] (f: (R) ⇒ B): ExtractableManagedResource[B]

    Definition Classes
    ManagedResourceOperations → ManagedResource
  22. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  23. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  24. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  25. def reflect [B] : R @util.continuations.package.cps[Either[List[Throwable],B]]

    Definition Classes
    ManagedResourceOperations → ManagedResource
  26. def string : String

    Loads all the characters into memory.

    Loads all the characters into memory. There is no protection against loading very large files/amounts of data.

    Definition Classes
    ReadChars
  27. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  28. def toString (): String

    Definition Classes
    AnyRef → Any
  29. def toTraversable [B] (implicit ev: <:<[R, TraversableOnce[B]]): Traversable[B]

    Definition Classes
    ManagedResourceOperations → ManagedResource
  30. def updateContext (f: (ResourceContext) ⇒ ResourceContext): ReadCharsResource[R]

    Update the current ResourceContext and return a new Resource instance with the updated context

    Update the current ResourceContext and return a new Resource instance with the updated context

    f

    A function for transforming the current context to a new context with new values.

    returns

    a new instance configured with the new context

    Definition Classes
    ResourceOps
  31. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from ReadChars

Inherited from Resource[R]

Inherited from ResourceOps[R, ReadCharsResource[R]]

Inherited from ManagedResourceOperations[R]

Inherited from ManagedResource[R]

Inherited from AnyRef

Inherited from Any