/** Get the first element you find and return it. Return Label.INVALID * otherwise. */ @Override public int getSingleElement() { for (int i = 0; i < (bits.length << LOG_BITS); i++) { if (member(i)) { return i; } } return Label.INVALID; }
/** Get the first element you find and return it. Return Label.INVALID * otherwise. */ public int getSingleElement() { for (int i = 0; i < (bits.length << LOG_BITS); i++) { if (member(i)) { return i; } } return Label.INVALID; }
/** Get the first element you find and return it. Return Label.INVALID * otherwise. */ public int getSingleElement() { for (int i = 0; i < (bits.length << LOG_BITS); i++) { if (member(i)) { return i; } } return Label.INVALID; }
/** Get the first element you find and return it. Return Label.INVALID * otherwise. */ @Override public int getSingleElement() { for (int i = 0; i < (bits.length << LOG_BITS); i++) { if (member(i)) { return i; } } return Label.INVALID; }
public int[] toArray() { int[] elems = new int[size()]; int en = 0; for (int i = 0; i < (bits.length << LOG_BITS); i++) { if (member(i)) { elems[en++] = i; } } return elems; }
public int[] toArray() { int[] elems = new int[size()]; int en = 0; for (int i = 0; i < (bits.length << LOG_BITS); i++) { if (member(i)) { elems[en++] = i; } } return elems; }
public int[] toArray() { int[] elems = new int[size()]; int en = 0; for (int i = 0; i < (bits.length << LOG_BITS); i++) { if (member(i)) { elems[en++] = i; } } return elems; }
public int[] toArray() { int[] elems = new int[size()]; int en = 0; for (int i = 0; i < (bits.length << LOG_BITS); i++) { if (member(i)) { elems[en++] = i; } } return elems; }
/** Transform a bit set into a string by formatting each element as an integer * separator The string to put in between elements * @return A commma-separated list of values */ public String toString(Grammar g) { StringBuffer buf = new StringBuffer(); String separator = ","; boolean havePrintedAnElement = false; buf.append('{'); for (int i = 0; i < (bits.length << LOG_BITS); i++) { if (member(i)) { if (i > 0 && havePrintedAnElement ) { buf.append(separator); } if ( g!=null ) { buf.append(g.getTokenDisplayName(i)); } else { buf.append(i); } havePrintedAnElement = true; } } buf.append('}'); return buf.toString(); }
/** Transform a bit set into a string by formatting each element as an integer * separator The string to put in between elements * @return A commma-separated list of values */ @Override public String toString(Grammar g) { StringBuilder buf = new StringBuilder(); String separator = ","; boolean havePrintedAnElement = false; buf.append('{'); for (int i = 0; i < (bits.length << LOG_BITS); i++) { if (member(i)) { if (i > 0 && havePrintedAnElement ) { buf.append(separator); } if ( g!=null ) { buf.append(g.getTokenDisplayName(i)); } else { buf.append(i); } havePrintedAnElement = true; } } buf.append('}'); return buf.toString(); }
/** Transform a bit set into a string by formatting each element as an integer * separator The string to put in between elements * @return A commma-separated list of values */ public String toString(Grammar g) { StringBuffer buf = new StringBuffer(); String separator = ","; boolean havePrintedAnElement = false; buf.append('{'); for (int i = 0; i < (bits.length << LOG_BITS); i++) { if (member(i)) { if (i > 0 && havePrintedAnElement ) { buf.append(separator); } if ( g!=null ) { buf.append(g.getTokenDisplayName(i)); } else { buf.append(i); } havePrintedAnElement = true; } } buf.append('}'); return buf.toString(); }
/** Transform a bit set into a string by formatting each element as an integer * separator The string to put in between elements * @return A commma-separated list of values */ @Override public String toString(Grammar g) { StringBuilder buf = new StringBuilder(); String separator = ","; boolean havePrintedAnElement = false; buf.append('{'); for (int i = 0; i < (bits.length << LOG_BITS); i++) { if (member(i)) { if (i > 0 && havePrintedAnElement ) { buf.append(separator); } if ( g!=null ) { buf.append(g.getTokenDisplayName(i)); } else { buf.append(i); } havePrintedAnElement = true; } } buf.append('}'); return buf.toString(); }
/**Create a string representation where instead of integer elements, the * ith element of vocabulary is displayed instead. Vocabulary is a Vector * of Strings. * separator The string to put in between elements * @return A commma-separated list of character constants. */ public String toString(String separator, List<String> vocabulary) { if (vocabulary == null) { return toString(null); } String str = ""; for (int i = 0; i < (bits.length << LOG_BITS); i++) { if (member(i)) { if (str.length() > 0) { str += separator; } if (i >= vocabulary.size()) { str += "'" + (char)i + "'"; } else if (vocabulary.get(i) == null) { str += "'" + (char)i + "'"; } else { str += vocabulary.get(i); } } } return str; }
/**Create a string representation where instead of integer elements, the * ith element of vocabulary is displayed instead. Vocabulary is a Vector * of Strings. * separator The string to put in between elements * @return A commma-separated list of character constants. */ public String toString(String separator, List vocabulary) { if (vocabulary == null) { return toString(null); } String str = ""; for (int i = 0; i < (bits.length << LOG_BITS); i++) { if (member(i)) { if (str.length() > 0) { str += separator; } if (i >= vocabulary.size()) { str += "'" + (char)i + "'"; } else if (vocabulary.get(i) == null) { str += "'" + (char)i + "'"; } else { str += (String)vocabulary.get(i); } } } return str; }
/**Create a string representation where instead of integer elements, the * ith element of vocabulary is displayed instead. Vocabulary is a Vector * of Strings. * separator The string to put in between elements * @return A commma-separated list of character constants. */ public String toString(String separator, List<String> vocabulary) { if (vocabulary == null) { return toString(null); } String str = ""; for (int i = 0; i < (bits.length << LOG_BITS); i++) { if (member(i)) { if (str.length() > 0) { str += separator; } if (i >= vocabulary.size()) { str += "'" + (char)i + "'"; } else if (vocabulary.get(i) == null) { str += "'" + (char)i + "'"; } else { str += vocabulary.get(i); } } } return str; }
/**Create a string representation where instead of integer elements, the * ith element of vocabulary is displayed instead. Vocabulary is a Vector * of Strings. * separator The string to put in between elements * @return A commma-separated list of character constants. */ public String toString(String separator, List vocabulary) { if (vocabulary == null) { return toString(null); } String str = ""; for (int i = 0; i < (bits.length << LOG_BITS); i++) { if (member(i)) { if (str.length() > 0) { str += separator; } if (i >= vocabulary.size()) { str += "'" + (char)i + "'"; } else if (vocabulary.get(i) == null) { str += "'" + (char)i + "'"; } else { str += (String)vocabulary.get(i); } } } return str; }
public static String getMessageType(int msgID) { if (getErrorState().warningMsgIDs.member(msgID)) { return messages.getInstanceOf("warning").toString(); } else if (getErrorState().errorMsgIDs.member(msgID)) { return messages.getInstanceOf("error").toString(); } assertTrue(false, "Assertion failed! Message ID " + msgID + " created but is not present in errorMsgIDs or warningMsgIDs."); return ""; }
public static String getMessageType(int msgID) { if (getErrorState().warningMsgIDs.member(msgID)) { return messages.getInstanceOf("warning").render(); } else if (getErrorState().errorMsgIDs.member(msgID)) { return messages.getInstanceOf("error").render(); } assertTrue(false, "Assertion failed! Message ID " + msgID + " created but is not present in errorMsgIDs or warningMsgIDs."); return ""; }
public static String getMessageType(int msgID) { if (getErrorState().warningMsgIDs.member(msgID)) { return messages.getInstanceOf("warning").render(); } else if (getErrorState().errorMsgIDs.member(msgID)) { return messages.getInstanceOf("error").render(); } assertTrue(false, "Assertion failed! Message ID " + msgID + " created but is not present in errorMsgIDs or warningMsgIDs."); return ""; }
public static String getMessageType(int msgID) { if (getErrorState().warningMsgIDs.member(msgID)) { return messages.getInstanceOf("warning").toString(); } else if (getErrorState().errorMsgIDs.member(msgID)) { return messages.getInstanceOf("error").toString(); } assertTrue(false, "Assertion failed! Message ID " + msgID + " created but is not present in errorMsgIDs or warningMsgIDs."); return ""; }