format source with scalafmt
This commit is contained in:
parent
0f40491d42
commit
ce404e4f53
1669 changed files with 43208 additions and 35404 deletions
|
|
@ -84,6 +84,7 @@ object Pair {
|
|||
*/
|
||||
@SerialVersionUID(1L)
|
||||
trait Creator[T] extends Serializable {
|
||||
|
||||
/**
|
||||
* This method must return a different instance upon every call.
|
||||
*/
|
||||
|
|
@ -139,9 +140,16 @@ abstract class JavaPartialFunction[A, B] extends AbstractPartialFunction[A, B] {
|
|||
@throws(classOf[Exception])
|
||||
def apply(x: A, isCheck: Boolean): B
|
||||
|
||||
final def isDefinedAt(x: A): Boolean = try { apply(x, true); true } catch { case NoMatch => false }
|
||||
final override def apply(x: A): B = try apply(x, false) catch { case NoMatch => throw new MatchError(x) }
|
||||
final override def applyOrElse[A1 <: A, B1 >: B](x: A1, default: A1 => B1): B1 = try apply(x, false) catch { case NoMatch => default(x) }
|
||||
final def isDefinedAt(x: A): Boolean =
|
||||
try {
|
||||
apply(x, true); true
|
||||
} catch { case NoMatch => false }
|
||||
final override def apply(x: A): B =
|
||||
try apply(x, false)
|
||||
catch { case NoMatch => throw new MatchError(x) }
|
||||
final override def applyOrElse[A1 <: A, B1 >: B](x: A1, default: A1 => B1): B1 =
|
||||
try apply(x, false)
|
||||
catch { case NoMatch => default(x) }
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -151,6 +159,7 @@ abstract class JavaPartialFunction[A, B] extends AbstractPartialFunction[A, B] {
|
|||
*/
|
||||
sealed abstract class Option[A] extends java.lang.Iterable[A] {
|
||||
def get: A
|
||||
|
||||
/**
|
||||
* Returns <code>a</code> if this is <code>some(a)</code> or <code>defaultValue</code> if
|
||||
* this is <code>none</code>.
|
||||
|
|
@ -163,6 +172,7 @@ sealed abstract class Option[A] extends java.lang.Iterable[A] {
|
|||
}
|
||||
|
||||
object Option {
|
||||
|
||||
/**
|
||||
* <code>Option</code> factory that creates <code>Some</code>
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue