Algorithmen & Datenstrukturen mit Java: ds.util.Undef
ds.util.Undef
1
package
ds
.
util
;
2
3
import
java
.
util
.
NoSuchElementException
;
4
5
public
class
Undef
{
6
public
static
RuntimeException
undef
(
String
msg
)
{
7
return
8
new
NoSuchElementException
(
msg
)
;
9
}
10
11
// undefined has an arbitrary type as result type
12
// so undefined may be called in arbitrary expression contexts
13
public
static
<
A
>
A
undefined
(
String
msg
)
{
14
throw
15
undef
(
msg
)
;
16
}
17
}
Die Quelle:
Undef.java
Letzte Änderung: 26.10.2017
©
Prof. Dr. Uwe Schmidt