/** * Copyright (c): Uwe Schmidt, FH Wedel * * You may study, modify and distribute this source code * FOR NON-COMMERCIAL PURPOSES ONLY. * This copyright message has to remain unchanged. * * Note that this document is provided 'as is', * WITHOUT WARRANTY of any kind either expressed or implied. */ package ds.util; import java.util.NoSuchElementException; public class Undef { public static RuntimeException undef(String msg) { return new NoSuchElementException(msg); } // undefined has an arbitrary type as result type // so undefined may be called in arbitrary expression contexts public static A undefined(String msg) { throw undef(msg); } }