publicboolean equals(Object other) { return other instanceof LineNumber && ((LineNumber)other).line == line &&
((LineNumber)other).location == location;
}
publicint compareTo(LineNumber other) { int v = Integer.valueOf(line).compareTo(Integer.valueOf(other.line)); if (v != 0) { return v;
} else { returnLong.valueOf(location).compareTo(Long.valueOf(other.location));
}
}
}
publicstaticnativevoid setBreakpoint(Executable m, long loc); publicstaticvoid setBreakpoint(Executable m, LineNumber l) {
setBreakpoint(m, l.location);
}
publicstaticnativevoid clearBreakpoint(Executable m, long loc); publicstaticvoid clearBreakpoint(Executable m, LineNumber l) {
clearBreakpoint(m, l.location);
}
privatestaticnative Object[] getLineNumberTableNative(Executable m); publicstatic LineNumber[] getLineNumberTable(Executable m) {
Object[] nativeTable = getLineNumberTableNative(m); long[] location = (long[])(nativeTable[0]); int[] lines = (int[])(nativeTable[1]); if (lines.length != location.length) { thrownew Error("Lines and locations have different lengths!");
}
LineNumber[] out = new LineNumber[lines.length]; for (int i = 0; i < lines.length; i++) {
out[i] = new LineNumber(location[i], lines[i]);
} return out;
}
publicstaticint locationToLine(Executable m, long location) { try {
Breakpoint.LineNumber[] lines = Breakpoint.getLineNumberTable(m); int best = -1; for (Breakpoint.LineNumber l : lines) { if (l.location > location) { break;
} else {
best = l.line;
}
} return best;
} catch (Exception e) { return -1;
}
}
publicstaticlong lineToLocation(Executable m, int line) throws Exception { try {
Breakpoint.LineNumber[] lines = Breakpoint.getLineNumberTable(m); for (Breakpoint.LineNumber l : lines) { if (l.line == line) { return l.location;
}
} thrownew Exception("Unable to find line " + line + " in " + m);
} catch (Exception e) { thrownew Exception("Unable to get line number info for " + m, e);
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.