summaryrefslogtreecommitdiff
path: root/sources/scala/PartialFunction.scala
diff options
context:
space:
mode:
authorMatthias Zenger <mzenger@gmail.com>2003-07-18 22:11:21 +0000
committerMatthias Zenger <mzenger@gmail.com>2003-07-18 22:11:21 +0000
commitc1bcad868c80dd4fabdb03af70539cb21ecb187f (patch)
tree86d07a11d322ce9ed438d68f403ac7e8a8229f83 /sources/scala/PartialFunction.scala
parent511713e0f473c8722c60d0efdfd934bc10281625 (diff)
downloadscala-c1bcad868c80dd4fabdb03af70539cb21ecb187f.tar.gz
scala-c1bcad868c80dd4fabdb03af70539cb21ecb187f.tar.bz2
scala-c1bcad868c80dd4fabdb03af70539cb21ecb187f.zip
Added some comments and removed inconsistencies.
Diffstat (limited to 'sources/scala/PartialFunction.scala')
-rw-r--r--sources/scala/PartialFunction.scala17
1 files changed, 15 insertions, 2 deletions
diff --git a/sources/scala/PartialFunction.scala b/sources/scala/PartialFunction.scala
index 82edad02cc..e0ed25c0bf 100644
--- a/sources/scala/PartialFunction.scala
+++ b/sources/scala/PartialFunction.scala
@@ -4,13 +4,26 @@
** __\ \/ /__/ __ |/ /__/ __ | **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
+** $Id$
\* */
-// $Id$
-
package scala;
+/** A partial function of type <code>PartialFunction[A, B]</code> is a
+ * unary function where the domain does not include all values of type
+ * <code>A</code>. The function <code>isDefinedAt</code> allows to
+ * test dynamically, if a value is in the domain of the function.
+ *
+ * @author Martin Odersky
+ * @version 1.0, 16/07/2003
+ */
trait PartialFunction[-A, +B] with Function1[A, B] {
+
+ /** Checks if a value is contained in the functions domain.
+ *
+ * @param x the value to test
+ * @returns true, iff <code>x</code> is in the domain of this function.
+ */
def isDefinedAt(x: A): Boolean;
}