homedukeAlgorithmen & Datenstrukturen mit Java: ds.util.Undef Prof. Dr. Uwe Schmidt FH Wedel

ds.util.Undef

   1package ds.util;
   2
   3import java.util.NoSuchElementException;
   4
   5public 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
Prof. Dr. Uwe Schmidt FH Wedel