List of usage examples for java.lang RuntimeException RuntimeException
public RuntimeException(Throwable cause)
From source file:Main.java
public static void dumpCursor(android.database.Cursor cursor, java.io.PrintStream stream) { throw new RuntimeException("Stub!"); }
From source file:Main.java
public static void formatNumber(android.text.Editable text, int defaultFormattingType) { throw new RuntimeException("Stub!"); }
From source file:Main.java
public static StartElement assertStart(String name, XMLEvent event) { if (!isTag(event, name)) { throw new RuntimeException("Was expecting a " + name + " tag, not this:" + event); }/* ww w .j ava2 s . c o m*/ return event.asStartElement(); }
From source file:Main.java
public static void dumpCurrentRow(android.database.Cursor cursor, java.io.PrintStream stream) { throw new RuntimeException("Stub!"); }
From source file:Main.java
public static byte[] strToBytes(String str, String charset) { try {/*from w w w . j a v a 2 s . c om*/ return str.getBytes(charset); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } }
From source file:Main.java
public static <T> Map<String, T> asMap(T... values) { Map<String, T> result = new HashMap<String, T>(); if (values.length % 2 != 0) { throw new RuntimeException("invalid params length"); }//w w w .ja va2 s .com if (values.length > 0) { for (int i = 0; i < values.length; i += 2) { result.put(values[i].toString(), values[i + 1]); } } return result; }
From source file:Main.java
public static float[] naivMatrixMultiply(float[] B, float[] A) { int mA, nA, mB, nB; mA = nA = (int) Math.sqrt(A.length); mB = nB = (int) Math.sqrt(B.length); if (nA != mB) throw new RuntimeException("Illegal matrix dimensions."); float[] C = new float[mA * nB]; for (int i = 0; i < mA; i++) for (int j = 0; j < nB; j++) for (int k = 0; k < nA; k++) C[i + nA * j] += (A[i + nA * k] * B[k + nB * j]); return C;/*from www . ja v a 2 s . c o m*/ }
From source file:Main.java
public static boolean compare(android.content.Context context, java.lang.String a, java.lang.String b) { throw new RuntimeException("Stub!"); }
From source file:Main.java
public static java.lang.String formatElapsedTime(java.lang.StringBuilder recycle, long elapsedSeconds) { throw new RuntimeException("Stub!"); }
From source file:Main.java
public static Object findOne(Collection coll) { if (coll.isEmpty()) { return null; } else if (coll.size() > 1) { throw new RuntimeException("Expected only one member in collection, found many: " + coll.toString()); } else {/*from w w w. j a va 2 s. c om*/ return coll.iterator().next(); } }