/** * Converts a Time MAL data type timestamp into a readable string * * @param timestamp Time * @return The String with the time */ public static String time2readableString(Time timestamp) { Date date = new Date(timestamp.getValue()); Format format = new SimpleDateFormat(DATE_PATTERN); return format.format(date); }
public Integer getOldestIndex(Long objId, double oldestTimeInMs) { // get index of oldestTimeInMs (or the next higher index, if oldestTimeInMs not in list) TimeList allTimes = timeSets.get(objId); if (allTimes == null) { return null; } int i = 0; for (; i < allTimes.size() && allTimes.get(i).getValue() < oldestTimeInMs; i++); return i; }
public static FineTime timeToFineTime(final Time time) { return (time == null) ? null : new FineTime(HelperTime.fromMilliToNano(time.getValue())); }
@Override public void encodeTime(final Time value) throws MALException { try { checkForNull(value); outputStream.addUnsignedLong(value.getValue()); } catch (IOException ex) { throw new MALException(ENCODING_EXCEPTION_STR, ex); } }
@Override public void encodeTime(final Time value) throws MALException { try { checkForNull(value); outputStream.addUnsignedLong(value.getValue()); } catch (IOException ex) { throw new MALException(ENCODING_EXCEPTION_STR, ex); } }
previousSetTimeStamp = new Time(currentTime.getValue() - (long) (updateInterval.getValue() * 1000)); } else { //otherwise its the time of the last value of the previous set previousSetTimeStamp = new Time(this.latestSampleTimeList.get(identityId).get(indexParameterSet - 1).getValue()); Time firstSampleTime = new Time(this.latestSampleTimeList.get(identityId).get(indexParameterSet).getValue() - (long) (sampleInterval.getValue() * 1000) * sampleCountList.get(identityId).get(indexParameterSet)); Duration deltaTime = new Duration(((float) (firstSampleTime.getValue() - previousSetTimeStamp.getValue())) / 1000);
final long timeSinceEvaluation = now - evaluationResults.get(i).getEvaluationTime().getValue(); boolean expired = true;
int counter = 0; for (ParameterValueEntry value : values) { if (now - value.getCreationTime().getValue() < Math.round(refValue.getDeltaTime().getValue() * 1000)) { counter++;
return (double) ((Time) in).getValue();
return String.valueOf(((Time) in).getValue());
Long now = (new Time()).getValue(); removeExpiredSamples(now, referenceValue, sampleTimes);