2015-07-30 20:14:55 +02:00
|
|
|
package juloo.keyboard2;
|
|
|
|
|
2015-08-18 01:25:47 +02:00
|
|
|
import android.view.KeyCharacterMap;
|
2015-07-30 20:14:55 +02:00
|
|
|
import android.view.KeyEvent;
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
2022-06-05 20:14:16 +02:00
|
|
|
final class KeyValue
|
2015-07-30 20:14:55 +02:00
|
|
|
{
|
2022-06-05 19:30:53 +02:00
|
|
|
public static enum Event
|
|
|
|
{
|
|
|
|
CONFIG,
|
|
|
|
SWITCH_TEXT,
|
|
|
|
SWITCH_NUMERIC,
|
|
|
|
SWITCH_EMOJI,
|
|
|
|
SWITCH_BACK_EMOJI,
|
|
|
|
CHANGE_METHOD,
|
|
|
|
ACTION,
|
|
|
|
SWITCH_PROGRAMMING
|
|
|
|
}
|
|
|
|
|
2022-06-05 01:38:42 +02:00
|
|
|
// Must be evaluated in the reverse order of their values.
|
2022-06-05 19:30:53 +02:00
|
|
|
public static enum Modifier
|
|
|
|
{
|
|
|
|
SHIFT,
|
|
|
|
FN,
|
|
|
|
CTRL,
|
|
|
|
ALT,
|
|
|
|
META,
|
|
|
|
DOUBLE_AIGU,
|
|
|
|
DOT_ABOVE,
|
|
|
|
GRAVE,
|
|
|
|
AIGU,
|
|
|
|
CIRCONFLEXE,
|
|
|
|
TILDE,
|
|
|
|
CEDILLE,
|
|
|
|
TREMA,
|
|
|
|
SUPERSCRIPT,
|
|
|
|
SUBSCRIPT,
|
|
|
|
RING,
|
|
|
|
CARON,
|
|
|
|
MACRON,
|
|
|
|
ORDINAL,
|
|
|
|
ARROWS,
|
|
|
|
BOX,
|
|
|
|
OGONEK,
|
|
|
|
SLASH,
|
|
|
|
ARROW_RIGHT
|
|
|
|
}
|
2022-06-05 01:38:42 +02:00
|
|
|
|
2022-06-05 19:55:55 +02:00
|
|
|
// Behavior flags.
|
|
|
|
public static final int FLAG_LATCH = (1 << 20);
|
|
|
|
public static final int FLAG_LOCK = (1 << 21);
|
|
|
|
// Special keys are not repeated and don't clear latched modifiers.
|
|
|
|
public static final int FLAG_SPECIAL = (1 << 22);
|
|
|
|
public static final int FLAG_PRECISE_REPEAT = (1 << 23);
|
|
|
|
// Rendering flags.
|
|
|
|
public static final int FLAG_KEY_FONT = (1 << 24);
|
|
|
|
public static final int FLAG_SMALLER_FONT = (1 << 25);
|
|
|
|
// Used by [Pointers].
|
|
|
|
public static final int FLAG_LOCKED = (1 << 26);
|
|
|
|
|
|
|
|
// Kinds
|
2022-06-05 19:30:53 +02:00
|
|
|
public static final int KIND_CHAR = (0 << 29);
|
|
|
|
public static final int KIND_STRING = (1 << 29);
|
|
|
|
public static final int KIND_KEYEVENT = (2 << 29);
|
|
|
|
public static final int KIND_EVENT = (3 << 29);
|
|
|
|
public static final int KIND_MODIFIER = (4 << 29);
|
2022-06-05 18:14:50 +02:00
|
|
|
|
2022-06-05 19:55:55 +02:00
|
|
|
// Ranges for the different components
|
|
|
|
private static final int FLAGS_BITS = (0b111111111 << 20); // 9 bits wide
|
|
|
|
private static final int KIND_BITS = (0b111 << 29); // 3 bits wide
|
|
|
|
private static final int VALUE_BITS = ~(FLAGS_BITS | KIND_BITS); // 20 bits wide
|
|
|
|
static
|
|
|
|
{
|
|
|
|
check((FLAGS_BITS & KIND_BITS) == 0); // No overlap
|
|
|
|
check((FLAGS_BITS | KIND_BITS | VALUE_BITS) == ~0); // No holes
|
|
|
|
}
|
2022-06-05 18:14:50 +02:00
|
|
|
|
2022-06-05 17:26:34 +02:00
|
|
|
private final String _symbol;
|
2022-06-05 01:38:42 +02:00
|
|
|
|
2022-06-05 19:55:55 +02:00
|
|
|
/** This field encodes three things:
|
|
|
|
- The kind
|
|
|
|
- The flags
|
|
|
|
- The value for Char, Event and Modifier keys.
|
|
|
|
*/
|
2022-06-05 17:26:34 +02:00
|
|
|
private final int _code;
|
|
|
|
|
|
|
|
public static enum Kind
|
|
|
|
{
|
2022-06-05 19:30:53 +02:00
|
|
|
Char, String, Keyevent, Event, Modifier
|
2022-06-05 17:26:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public Kind getKind()
|
|
|
|
{
|
2022-06-05 19:55:55 +02:00
|
|
|
switch (_code & KIND_BITS)
|
2022-06-05 18:14:50 +02:00
|
|
|
{
|
|
|
|
case KIND_CHAR: return Kind.Char;
|
|
|
|
case KIND_STRING: return Kind.String;
|
2022-06-05 19:30:53 +02:00
|
|
|
case KIND_KEYEVENT: return Kind.Keyevent;
|
2022-06-05 18:14:50 +02:00
|
|
|
case KIND_EVENT: return Kind.Event;
|
|
|
|
case KIND_MODIFIER: return Kind.Modifier;
|
|
|
|
default: throw new RuntimeException("Corrupted kind flags");
|
|
|
|
}
|
2022-06-05 17:26:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public int getFlags()
|
|
|
|
{
|
2022-06-05 19:55:55 +02:00
|
|
|
return (_code & FLAGS_BITS);
|
2022-06-05 17:26:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean hasFlags(int has)
|
|
|
|
{
|
2022-06-05 19:55:55 +02:00
|
|
|
return ((_code & has) == has);
|
2022-06-05 17:26:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/** The string to render on the keyboard.
|
|
|
|
When [getKind() == Kind.String], also the string to send. */
|
|
|
|
public String getString()
|
|
|
|
{
|
|
|
|
return _symbol;
|
|
|
|
}
|
|
|
|
|
2022-06-05 19:30:53 +02:00
|
|
|
/** Defined only when [getKind() == Kind.Char]. */
|
2022-06-05 17:26:34 +02:00
|
|
|
public char getChar()
|
|
|
|
{
|
2022-06-05 19:55:55 +02:00
|
|
|
return (char)(_code & VALUE_BITS);
|
2022-06-05 17:26:34 +02:00
|
|
|
}
|
|
|
|
|
2022-06-05 19:30:53 +02:00
|
|
|
/** Defined only when [getKind() == Kind.Keyevent]. */
|
|
|
|
public int getKeyevent()
|
2022-06-05 17:26:34 +02:00
|
|
|
{
|
2022-06-05 19:55:55 +02:00
|
|
|
return (_code & VALUE_BITS);
|
2022-06-05 17:26:34 +02:00
|
|
|
}
|
|
|
|
|
2022-06-05 19:30:53 +02:00
|
|
|
/** Defined only when [getKind() == Kind.Event]. */
|
|
|
|
public Event getEvent()
|
2022-06-05 17:26:34 +02:00
|
|
|
{
|
2022-06-05 19:55:55 +02:00
|
|
|
return Event.values()[(_code & VALUE_BITS)];
|
2022-06-05 19:30:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/** Defined only when [getKind() == Kind.Modifier]. */
|
|
|
|
public Modifier getModifier()
|
|
|
|
{
|
2022-06-05 19:55:55 +02:00
|
|
|
return Modifier.values()[(_code & VALUE_BITS)];
|
2022-06-05 17:26:34 +02:00
|
|
|
}
|
2021-04-18 23:28:49 +02:00
|
|
|
|
2021-05-08 02:00:47 +02:00
|
|
|
/* Update the char and the symbol. */
|
2022-06-05 18:14:50 +02:00
|
|
|
public KeyValue withChar(char c)
|
2021-05-08 02:00:47 +02:00
|
|
|
{
|
2022-06-06 00:23:45 +02:00
|
|
|
return new KeyValue(String.valueOf(c), KIND_CHAR, c, getFlags());
|
2021-05-08 02:00:47 +02:00
|
|
|
}
|
|
|
|
|
2022-06-05 18:14:50 +02:00
|
|
|
public KeyValue withString(String s)
|
2021-04-18 23:28:49 +02:00
|
|
|
{
|
2022-06-06 00:23:45 +02:00
|
|
|
return new KeyValue(s, KIND_STRING, 0, getFlags());
|
2021-04-18 23:28:49 +02:00
|
|
|
}
|
|
|
|
|
2022-06-06 00:23:45 +02:00
|
|
|
public KeyValue withSymbol(String s)
|
2022-03-06 19:36:09 +01:00
|
|
|
{
|
2022-06-06 00:23:45 +02:00
|
|
|
return new KeyValue(s, (_code & KIND_BITS), (_code & VALUE_BITS), getFlags());
|
2022-03-06 19:36:09 +01:00
|
|
|
}
|
|
|
|
|
2022-06-05 19:30:53 +02:00
|
|
|
public KeyValue withKeyevent(int code)
|
2022-06-05 17:44:00 +02:00
|
|
|
{
|
2022-06-06 00:23:45 +02:00
|
|
|
return new KeyValue(_symbol, KIND_KEYEVENT, code, getFlags());
|
2022-06-05 17:44:00 +02:00
|
|
|
}
|
|
|
|
|
2022-03-05 20:17:45 +01:00
|
|
|
public KeyValue withFlags(int f)
|
|
|
|
{
|
2022-06-06 00:23:45 +02:00
|
|
|
return new KeyValue(_symbol, (_code & KIND_BITS), (_code & VALUE_BITS), f);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean equals(Object obj)
|
|
|
|
{
|
|
|
|
KeyValue snd = (KeyValue)obj;
|
|
|
|
return _symbol.equals(snd._symbol) && _code == snd._code;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int hashCode()
|
|
|
|
{
|
|
|
|
return _symbol.hashCode() + _code;
|
2022-03-05 20:17:45 +01:00
|
|
|
}
|
|
|
|
|
2021-04-18 23:28:49 +02:00
|
|
|
private static HashMap<String, KeyValue> keys = new HashMap<String, KeyValue>();
|
|
|
|
|
2022-06-06 00:23:45 +02:00
|
|
|
public KeyValue(String s, int kind, int value, int flags)
|
2021-04-18 23:28:49 +02:00
|
|
|
{
|
2022-06-05 19:55:55 +02:00
|
|
|
check((kind & ~KIND_BITS) == 0);
|
|
|
|
check((flags & ~FLAGS_BITS) == 0);
|
|
|
|
check((value & ~VALUE_BITS) == 0);
|
2022-06-05 17:26:34 +02:00
|
|
|
_symbol = s;
|
2022-06-05 19:55:55 +02:00
|
|
|
_code = kind | flags | value;
|
2021-04-18 23:28:49 +02:00
|
|
|
}
|
|
|
|
|
2021-12-19 19:44:27 +01:00
|
|
|
public static KeyValue getKeyByName(String name)
|
2021-04-18 23:28:49 +02:00
|
|
|
{
|
2022-06-24 20:26:27 +02:00
|
|
|
KeyValue kv = keys.get(name);
|
2021-05-08 02:00:47 +02:00
|
|
|
if (kv != null)
|
|
|
|
return kv;
|
2022-06-05 18:14:50 +02:00
|
|
|
if (name.length() == 1)
|
2022-06-06 00:23:45 +02:00
|
|
|
return new KeyValue(name, KIND_CHAR, name.charAt(0), 0);
|
2022-06-05 18:14:50 +02:00
|
|
|
else
|
2022-06-06 00:23:45 +02:00
|
|
|
return new KeyValue(name, KIND_STRING, 0, 0);
|
2021-04-18 23:28:49 +02:00
|
|
|
}
|
2015-08-01 16:33:30 +02:00
|
|
|
|
2022-06-05 18:14:50 +02:00
|
|
|
private static void addKey(String name, String symbol, int kind, int code, int flags)
|
2021-04-18 21:58:13 +02:00
|
|
|
{
|
2022-06-06 00:23:45 +02:00
|
|
|
keys.put(name, new KeyValue(symbol, kind, code, flags));
|
2021-04-18 21:58:13 +02:00
|
|
|
}
|
|
|
|
|
2022-06-05 17:44:00 +02:00
|
|
|
private static void addCharKey(String name, String symbol, char c, int flags)
|
2022-01-09 12:49:28 +01:00
|
|
|
{
|
2022-06-05 18:14:50 +02:00
|
|
|
addKey(name, symbol, KIND_CHAR, c, flags);
|
2021-04-18 21:58:13 +02:00
|
|
|
}
|
|
|
|
|
2022-06-05 19:30:53 +02:00
|
|
|
private static void addModifierKey(String name, String symbol, Modifier m, int extra_flags)
|
2021-04-18 21:58:13 +02:00
|
|
|
{
|
2022-06-05 19:30:53 +02:00
|
|
|
addKey(name, symbol, KIND_MODIFIER, m.ordinal(),
|
2022-06-05 18:14:50 +02:00
|
|
|
FLAG_LATCH | FLAG_SPECIAL | extra_flags);
|
2022-02-13 13:46:37 +01:00
|
|
|
}
|
|
|
|
|
2022-06-05 19:30:53 +02:00
|
|
|
private static void addEventKey(String name, String symbol, Event e, int flags)
|
2022-02-13 13:46:37 +01:00
|
|
|
{
|
2022-06-05 19:30:53 +02:00
|
|
|
addKey(name, symbol, KIND_EVENT, e.ordinal(), flags | FLAG_SPECIAL);
|
2021-04-18 21:58:13 +02:00
|
|
|
}
|
|
|
|
|
2022-06-05 19:30:53 +02:00
|
|
|
private static void addKeyeventKey(String name, String symbol, int code, int flags)
|
2021-04-19 22:29:20 +02:00
|
|
|
{
|
2022-06-05 19:30:53 +02:00
|
|
|
addKey(name, symbol, KIND_KEYEVENT, code, flags);
|
2021-04-19 22:29:20 +02:00
|
|
|
}
|
|
|
|
|
2022-06-24 20:56:04 +02:00
|
|
|
// Within VALUE_BITS
|
|
|
|
private static int placeholder_unique_id = 0;
|
|
|
|
|
|
|
|
/** Use a unique id as the value because the symbol is shared between every
|
|
|
|
placeholders (it is the empty string). */
|
2022-06-06 00:23:45 +02:00
|
|
|
private static void addPlaceholderKey(String name)
|
|
|
|
{
|
2022-06-24 20:56:04 +02:00
|
|
|
addKey(name, "", KIND_STRING, placeholder_unique_id++, 0);
|
2022-06-06 00:23:45 +02:00
|
|
|
}
|
|
|
|
|
2021-04-18 21:58:13 +02:00
|
|
|
static
|
|
|
|
{
|
2022-03-18 12:24:29 +01:00
|
|
|
addModifierKey("shift", "\n", // Can't write u000A because Java is stupid
|
2022-06-05 19:30:53 +02:00
|
|
|
Modifier.SHIFT, FLAG_KEY_FONT | FLAG_SMALLER_FONT);
|
|
|
|
addModifierKey("ctrl", "Ctrl", Modifier.CTRL, FLAG_SMALLER_FONT);
|
|
|
|
addModifierKey("alt", "Alt", Modifier.ALT, FLAG_SMALLER_FONT);
|
|
|
|
addModifierKey("accent_aigu", "\u0050", Modifier.AIGU, FLAG_KEY_FONT);
|
|
|
|
addModifierKey("accent_caron", "\u0051", Modifier.CARON, FLAG_KEY_FONT);
|
|
|
|
addModifierKey("accent_cedille", "\u0052", Modifier.CEDILLE, FLAG_KEY_FONT);
|
|
|
|
addModifierKey("accent_circonflexe", "\u0053", Modifier.CIRCONFLEXE, FLAG_KEY_FONT);
|
|
|
|
addModifierKey("accent_grave", "\u0054", Modifier.GRAVE, FLAG_KEY_FONT);
|
|
|
|
addModifierKey("accent_macron", "\u0055", Modifier.MACRON, FLAG_KEY_FONT);
|
|
|
|
addModifierKey("accent_ring", "\u0056", Modifier.RING, FLAG_KEY_FONT);
|
|
|
|
addModifierKey("accent_tilde", "\u0057", Modifier.TILDE, FLAG_KEY_FONT);
|
|
|
|
addModifierKey("accent_trema", "\u0058", Modifier.TREMA, FLAG_KEY_FONT);
|
|
|
|
addModifierKey("accent_ogonek", "\u0059", Modifier.OGONEK, FLAG_KEY_FONT);
|
|
|
|
addModifierKey("accent_dot_above", "\u005a", Modifier.DOT_ABOVE, FLAG_KEY_FONT);
|
|
|
|
addModifierKey("accent_double_aigu", "\u005b", Modifier.DOUBLE_AIGU, FLAG_KEY_FONT);
|
2022-06-05 12:02:35 +02:00
|
|
|
addModifierKey("accent_slash", "\134", // Can't write u005c
|
2022-06-05 19:30:53 +02:00
|
|
|
Modifier.SLASH, FLAG_KEY_FONT);
|
|
|
|
addModifierKey("accent_arrow_right", "\u005d", Modifier.ARROW_RIGHT, FLAG_KEY_FONT);
|
|
|
|
addModifierKey("superscript", "Sup", Modifier.SUPERSCRIPT, FLAG_SMALLER_FONT);
|
|
|
|
addModifierKey("subscript", "Sub", Modifier.SUBSCRIPT, FLAG_SMALLER_FONT);
|
|
|
|
addModifierKey("ordinal", "Ord", Modifier.ORDINAL, FLAG_SMALLER_FONT);
|
|
|
|
addModifierKey("arrows", "Arr", Modifier.ARROWS, FLAG_SMALLER_FONT);
|
|
|
|
addModifierKey("box", "Box", Modifier.BOX, FLAG_SMALLER_FONT);
|
|
|
|
addModifierKey("fn", "Fn", Modifier.FN, FLAG_SMALLER_FONT);
|
|
|
|
addModifierKey("meta", "Meta", Modifier.META, FLAG_SMALLER_FONT);
|
|
|
|
|
|
|
|
addEventKey("config", "\u0004", Event.CONFIG, FLAG_KEY_FONT | FLAG_SMALLER_FONT);
|
|
|
|
addEventKey("switch_text", "ABC", Event.SWITCH_TEXT, FLAG_SMALLER_FONT);
|
|
|
|
addEventKey("switch_numeric", "123+", Event.SWITCH_NUMERIC, FLAG_SMALLER_FONT);
|
|
|
|
addEventKey("switch_emoji", "\u0001" , Event.SWITCH_EMOJI, FLAG_KEY_FONT | FLAG_SMALLER_FONT);
|
|
|
|
addEventKey("switch_back_emoji", "ABC", Event.SWITCH_BACK_EMOJI, 0);
|
|
|
|
addEventKey("switch_programming", "Prog", Event.SWITCH_PROGRAMMING, FLAG_SMALLER_FONT);
|
|
|
|
addEventKey("change_method", "\u0009", Event.CHANGE_METHOD, FLAG_KEY_FONT | FLAG_SMALLER_FONT);
|
|
|
|
addEventKey("action", "Action", Event.ACTION, FLAG_SMALLER_FONT); // Will always be replaced
|
|
|
|
|
|
|
|
addKeyeventKey("esc", "Esc", KeyEvent.KEYCODE_ESCAPE, FLAG_SMALLER_FONT);
|
|
|
|
addKeyeventKey("enter", "\u000E", KeyEvent.KEYCODE_ENTER, FLAG_KEY_FONT);
|
|
|
|
addKeyeventKey("up", "\u0005", KeyEvent.KEYCODE_DPAD_UP, FLAG_KEY_FONT | FLAG_PRECISE_REPEAT);
|
|
|
|
addKeyeventKey("right", "\u0006", KeyEvent.KEYCODE_DPAD_RIGHT, FLAG_KEY_FONT | FLAG_PRECISE_REPEAT);
|
|
|
|
addKeyeventKey("down", "\u0007", KeyEvent.KEYCODE_DPAD_DOWN, FLAG_KEY_FONT | FLAG_PRECISE_REPEAT);
|
|
|
|
addKeyeventKey("left", "\u0008", KeyEvent.KEYCODE_DPAD_LEFT, FLAG_KEY_FONT | FLAG_PRECISE_REPEAT);
|
|
|
|
addKeyeventKey("page_up", "\u0002", KeyEvent.KEYCODE_PAGE_UP, FLAG_KEY_FONT);
|
|
|
|
addKeyeventKey("page_down", "\u0003", KeyEvent.KEYCODE_PAGE_DOWN, FLAG_KEY_FONT);
|
|
|
|
addKeyeventKey("home", "\u000B", KeyEvent.KEYCODE_MOVE_HOME, FLAG_KEY_FONT);
|
|
|
|
addKeyeventKey("end", "\u000C", KeyEvent.KEYCODE_MOVE_END, FLAG_KEY_FONT);
|
|
|
|
addKeyeventKey("backspace", "\u0011", KeyEvent.KEYCODE_DEL, FLAG_KEY_FONT);
|
|
|
|
addKeyeventKey("delete", "\u0010", KeyEvent.KEYCODE_FORWARD_DEL, FLAG_KEY_FONT);
|
|
|
|
addKeyeventKey("insert", "Ins", KeyEvent.KEYCODE_INSERT, FLAG_SMALLER_FONT);
|
|
|
|
addKeyeventKey("f1", "F1", KeyEvent.KEYCODE_F1, 0);
|
|
|
|
addKeyeventKey("f2", "F2", KeyEvent.KEYCODE_F2, 0);
|
|
|
|
addKeyeventKey("f3", "F3", KeyEvent.KEYCODE_F3, 0);
|
|
|
|
addKeyeventKey("f4", "F4", KeyEvent.KEYCODE_F4, 0);
|
|
|
|
addKeyeventKey("f5", "F5", KeyEvent.KEYCODE_F5, 0);
|
|
|
|
addKeyeventKey("f6", "F6", KeyEvent.KEYCODE_F6, 0);
|
|
|
|
addKeyeventKey("f7", "F7", KeyEvent.KEYCODE_F7, 0);
|
|
|
|
addKeyeventKey("f8", "F8", KeyEvent.KEYCODE_F8, 0);
|
|
|
|
addKeyeventKey("f9", "F9", KeyEvent.KEYCODE_F9, 0);
|
|
|
|
addKeyeventKey("f10", "F10", KeyEvent.KEYCODE_F10, 0);
|
|
|
|
addKeyeventKey("f11", "F11", KeyEvent.KEYCODE_F11, FLAG_SMALLER_FONT);
|
|
|
|
addKeyeventKey("f12", "F12", KeyEvent.KEYCODE_F12, FLAG_SMALLER_FONT);
|
|
|
|
addKeyeventKey("tab", "\u000F", KeyEvent.KEYCODE_TAB, FLAG_KEY_FONT | FLAG_SMALLER_FONT);
|
2021-04-18 21:58:13 +02:00
|
|
|
|
2022-06-05 17:44:00 +02:00
|
|
|
addCharKey("\\t", "\\t", '\t', 0); // Send the tab character
|
|
|
|
addCharKey("space", "\r", ' ', FLAG_KEY_FONT);
|
|
|
|
addCharKey("nbsp", "\u237d", '\u00a0', FLAG_KEY_FONT | FLAG_SMALLER_FONT);
|
2022-06-05 20:15:11 +02:00
|
|
|
|
2022-06-06 00:23:45 +02:00
|
|
|
addPlaceholderKey("removed");
|
|
|
|
addPlaceholderKey("f11_placeholder");
|
|
|
|
addPlaceholderKey("f12_placeholder");
|
2021-04-18 21:58:13 +02:00
|
|
|
}
|
2022-06-05 19:55:55 +02:00
|
|
|
|
|
|
|
// Substitute for [assert], which has no effect on Android.
|
|
|
|
private static void check(boolean b)
|
|
|
|
{
|
|
|
|
if (!b)
|
|
|
|
throw new RuntimeException("Assertion failure");
|
|
|
|
}
|
2015-07-30 20:14:55 +02:00
|
|
|
}
|