@Override public synchronized void setTotalStepCount(int totalStepCount) { if (completed || this.totalStepCount == totalStepCount) { return; } this.totalStepCount = totalStepCount; if (totalStepCount >= 0 && this.currentStepCount > totalStepCount) { this.currentStepCount = totalStepCount; } fireEvent(new ProgressStatusEventSet(id, totalStepCount, null)); }
public static void readToPSEventSet(ProgressStatusEventSet event, JsonParser jp) throws IOException { while (jp.nextToken() != JsonToken.END_OBJECT) { String fieldname = jp.getCurrentName(); jp.nextToken(); // move to value if ("total-step-count".equals(fieldname)) { event.setTotalStepCount(jp.getIntValue()); } else if ("current-step-count".equals(fieldname)) { event.setCurrentStepCount(jp.getIntValue()); } } }
ProgressStatusEventSet event = new ProgressStatusEventSet(id); if (newCurrentStepCount != currentStepCount) { currentStepCount = newCurrentStepCount; event.setCurrentStepCount(currentStepCount); event.setTotalStepCount(totalStepCount); if (event.getCurrentStepCount() != null || event.getTotalStepCount() != null) { super.fireEvent(event);
ProgressStatusEventSet event = new ProgressStatusEventSet(id); if (newCurrentStepCount != currentStepCount) { currentStepCount = newCurrentStepCount; event.setCurrentStepCount(currentStepCount); event.setTotalStepCount(totalStepCount); if (event.getCurrentStepCount() != null || event.getTotalStepCount() != null) { super.fireEvent(event);
@Override public synchronized void setTotalStepCount(int totalStepCount) { if (completed || this.totalStepCount == totalStepCount) { return; } this.totalStepCount = totalStepCount; if (totalStepCount >= 0 && this.currentStepCount > totalStepCount) { this.currentStepCount = totalStepCount; } fireEvent(new ProgressStatusEventSet(id, totalStepCount, null)); }
@Override public synchronized void setCurrentStepCount(int stepCount) { if (completed) { return; } boolean stepsChanged = false; if (stepCount >= 0 && stepCount != currentStepCount) { if (totalStepCount < 0 || stepCount < totalStepCount) { currentStepCount = stepCount; stepsChanged = true; } else if (currentStepCount != totalStepCount) { currentStepCount = totalStepCount; stepsChanged = true; } } if (stepsChanged) { fireEvent(new ProgressStatusEventSet(id, null, stepCount)); } }
@Override public synchronized void setCurrentStepCount(int stepCount) { if (completed) { return; } boolean stepsChanged = false; if (stepCount >= 0 && stepCount != currentStepCount) { if (totalStepCount < 0 || stepCount < totalStepCount) { currentStepCount = stepCount; stepsChanged = true; } else if (currentStepCount != totalStepCount) { currentStepCount = totalStepCount; stepsChanged = true; } } if (stepsChanged) { fireEvent(new ProgressStatusEventSet(id, null, stepCount)); } }
public static ProgressStatusEvent readProgressStatusEvent(JsonParser jp) throws IOException { String id = null; JsonToken token = null; ProgressStatusEvent result = null; while ((token = jp.nextToken()) != JsonToken.END_OBJECT) { if (token == JsonToken.START_OBJECT) { String nm = jp.getCurrentName(); if ("set".equals(nm)) { result = new ProgressStatusEventSet(id); readToPSEventSet((ProgressStatusEventSet) result, jp); } else if ("progres".equals(nm)) { result = new ProgressStatusEventProgress(id); readToPSEventProgress((ProgressStatusEventProgress) result, jp); } else if ("complete".equals(nm)) { result = new ProgressStatusEventComplete(id); readToPSEventComplete((ProgressStatusEventComplete) result, jp); } else if ("create-child".equals(nm)) { result = new ProgressStatusEventCreateChild(id); readToPSEventCreateChild((ProgressStatusEventCreateChild) result, jp); } } else { String fieldname = jp.getCurrentName(); if ("id".equals(fieldname)) { jp.nextToken(); // move to value id = jp.getText(); } } } return result; }