object
ResourceLoan extends ResourceLoan
Type Members
-
class
LoanStatement[A <: AutoCloseable] extends AnyRef
Value Members
-
final
def
!=(arg0: AnyRef): Boolean
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: AnyRef): Boolean
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
def
loan[A <: AutoCloseable](resource: A): LoanStatement[A]
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
Inherited from AnyRef
Inherited from Any
An object which provides Java's basic "try-with-resources" statement.
Usage example:
In this example,
w.close()
is guaranteed to get called even if the to-function terminates with a Throwable.In general, if the to-function throws a throwable
t1
and theAutoCloseable.close()
method throws another throwablet2
, then the throwablet2
gets added to the throwablet1
usingt1.addSuppressed(t2)
.The Java Language Specification: Java SE 7 Edition: 14.20.3.1 Basic try-with-resources