use of jsinterop.annotations.JsIgnore in project edumips64 by lupino3.
the class Instruction method FromInstruction.
@JsIgnore()
public static Instruction FromInstruction(InstructionInterface i) {
if (i == null) {
return null;
}
Instruction instruction = new Instruction();
instruction.Name = i.getName();
instruction.Code = i.getFullName();
instruction.SerialNumber = i.getSerialNumber();
instruction.Comment = i.getComment();
instruction.BinaryRepresentation = i.getRepr().getBinString();
instruction.OpCode = instruction.BinaryRepresentation.substring(0, 6);
ParsedInstructionMetadata meta = i.getParsingMetadata();
if (meta != null) {
instruction.Address = meta.address;
instruction.Line = meta.sourceLine;
}
return instruction;
}
use of jsinterop.annotations.JsIgnore in project deephaven-core by deephaven.
the class JsTotalsTableConfig method parse.
/**
* Implementation from TotalsTableBuilder.fromDirective, plus changes required to make this able to act on plan JS
* objects/arrays.
*
* Note that this omits groupBy for now, until the server directive format supports it!
*/
@JsIgnore
public static JsTotalsTableConfig parse(String configString) {
JsTotalsTableConfig builder = new JsTotalsTableConfig();
if (configString == null || configString.isEmpty()) {
return builder;
}
final String[] splitSemi = configString.split(";");
final String[] frontMatter = splitSemi[0].split(",");
if (frontMatter.length < 3) {
throw new IllegalArgumentException("Invalid Totals Table: " + configString);
}
builder.showTotalsByDefault = Boolean.parseBoolean(frontMatter[0]);
builder.showGrandTotalsByDefault = Boolean.parseBoolean(frontMatter[1]);
builder.defaultOperation = frontMatter[2];
checkOperation(builder.defaultOperation);
if (splitSemi.length > 1) {
final String[] columnDirectives = splitSemi[1].split(",");
for (final String columnDirective : columnDirectives) {
if (columnDirective.trim().isEmpty())
continue;
final String[] kv = columnDirective.split("=");
if (kv.length != 2) {
throw new IllegalArgumentException("Invalid Totals Table: " + configString + ", bad column " + columnDirective);
}
final String[] operations = kv[1].split(":");
builder.operationMap.set(kv[0], new JsArray<>());
for (String op : operations) {
checkOperation(op);
builder.operationMap.get(kv[0]).push(Js.<JsString>cast(op));
}
}
}
return builder;
}
use of jsinterop.annotations.JsIgnore in project deephaven-core by deephaven.
the class TableMap method notifyKeyAdded.
@JsIgnore
public void notifyKeyAdded(Object key) {
LocalKey k = LocalKey.of(key);
if (!tables.containsKey(k)) {
put(key, k);
CustomEventInit init = CustomEventInit.create();
init.setDetail(key);
fireEvent(EVENT_KEYADDED, init);
}
}
use of jsinterop.annotations.JsIgnore in project deephaven-core by deephaven.
the class JsDateTimeFormat method parseWithTimezoneAsLong.
@JsIgnore
public long parseWithTimezoneAsLong(String dateTimeString, com.google.gwt.i18n.client.TimeZone timeZone, boolean needsAdjustment) {
final long nanos = parse(dateTimeString, null).getWrapped();
final int remainder = (int) (nanos % JsDateTimeFormat.NANOS_PER_MILLI);
long millis = nanos / JsDateTimeFormat.NANOS_PER_MILLI;
final Date date = new Date(millis);
final int diff = (date.getTimezoneOffset() - timeZone.getStandardOffset()) * NUM_MILLISECONDS_IN_MINUTE;
// Adjust time for timezone offset difference
millis -= diff;
final int[] transitionPoints = getTransitionPoints(timeZone);
// If there are no transition points, skip the dst adjustment
if (needsAdjustment && transitionPoints != null) {
final int timeInHours = (int) (millis / 1000 / 3600);
int index = Arrays.binarySearch(transitionPoints, timeInHours);
if (index < 0) {
index = Math.abs(index) - 1;
}
// Change to a zero based index
index = index - 1;
final int transitionPoint = (index < 0) ? 0 : transitionPoints[index];
final int[] adjustments = getAdjustments(timeZone);
final int adjustment = (index < 0) ? 0 : adjustments[index];
// Adjust time for DST transition
millis = millis - (adjustment * NUM_MILLISECONDS_IN_MINUTE);
// Look for times that occur during the DST transition
// Adjustment is in minutes, so convert everything to minutes
final int timeInMinutes = (int) (millis / NUM_MILLISECONDS_IN_MINUTE);
final int transitionMinutes = transitionPoint * 60;
// This is the Spring DST transition Check
if (timeInMinutes > transitionMinutes && timeInMinutes < transitionMinutes + adjustment) {
// The format call is expensive, so we check the transition plus adjustment first
final String formatAfterAdjustment = format(LongWrapper.of(millis * NANOS_PER_MILLI), new JsTimeZone(timeZone));
if (!formatAfterAdjustment.equals(dateTimeString)) {
throw new IllegalArgumentException(dateTimeString + " occurs during a DST transition" + " timeInMinutes = " + timeInMinutes + " transitionMinutes = " + transitionMinutes + " adjustment = " + adjustment);
}
}
if (index < transitionPoints.length - 1) {
final int nextTransitionMinutes = transitionPoints[index + 1] * 60;
final int nextAdjustment = adjustments[index + 1];
if (timeInMinutes > nextTransitionMinutes && timeInMinutes < nextTransitionMinutes + nextAdjustment) {
// The format call is expensive, so we check the transition plus adjustment first
final String formatAfterAdjustment = format(LongWrapper.of(millis * NANOS_PER_MILLI), new JsTimeZone(timeZone));
if (!formatAfterAdjustment.equals(dateTimeString)) {
throw new IllegalArgumentException(dateTimeString + " occurs during a DST transition" + " timeInMinutes = " + timeInMinutes + " nextTransitionMinutes = " + nextTransitionMinutes + " nextAdjustment = " + nextAdjustment);
}
}
}
// This is the Fall DST transition check
if (adjustment == 0 && index > 0) {
final int prevAdjustment = adjustments[index - 1];
if (timeInMinutes > transitionMinutes && timeInMinutes < transitionMinutes + prevAdjustment) {
throw new IllegalArgumentException(dateTimeString + " occurs during a DST transition" + " timeInMinutes = " + timeInMinutes + " transitionMinutes = " + transitionMinutes + " prevAdjustment = " + prevAdjustment);
}
}
if (index < transitionPoints.length - 1) {
final int nextAdjustment = adjustments[index + 1];
if (nextAdjustment == 0) {
final int nextTransitionMinutes = transitionPoints[index + 1] * 60;
if (timeInMinutes < nextTransitionMinutes && timeInMinutes > nextTransitionMinutes - adjustment) {
throw new IllegalArgumentException(dateTimeString + " occurs during a DST transition" + " timeInMinutes = " + timeInMinutes + " nextTransitionMinutes = " + nextTransitionMinutes + " adjustment = " + adjustment);
}
}
}
}
return millis * JsDateTimeFormat.NANOS_PER_MILLI + remainder;
}
use of jsinterop.annotations.JsIgnore in project deephaven-core by deephaven.
the class JsFigure method verifyTables.
/**
* Verifies that the underlying tables have the columns the series are expected. Throws an FigureSourceException if
* not found
*/
@JsIgnore
public void verifyTables() {
Arrays.stream(charts).flatMap(c -> Arrays.stream(c.getSeries())).forEach(s -> {
JsTable table = tableForSeries(s);
Arrays.stream(s.getSources()).forEach(source -> {
try {
table.findColumn(source.getDescriptor().getColumnName());
} catch (NoSuchElementException e) {
throw new FigureSourceException(table, source, e.toString());
}
});
});
}
Aggregations