/** * Returns the current time encapsulated in a Time type * * @return The current time */ public static Time getTimestampMillis() { return new Time(System.currentTimeMillis()); }
/** * 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); }
if (! utc.equals(other.utc))
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);
/** * Returns a hash code for this object. * @return a hash code value for this object. */ public int hashCode() { int hash = 7; hash = 83 * hash + (utc != null ? utc.hashCode() : 0); hash = 83 * hash + (fixQuality != null ? fixQuality.hashCode() : 0); hash = 83 * hash + (numberOfSatellites != null ? numberOfSatellites.hashCode() : 0); hash = 83 * hash + (hdop != null ? hdop.hashCode() : 0); hash = 83 * hash + (undulation != null ? undulation.hashCode() : 0); return hash; }
final List<ParameterValueEntry> paramValues = parameterValues.get(paramIdentityId); ParameterValue oldParamValue = paramValues.get(paramValues.size() - 1).getValue(); paramValues.add(new ParameterValueEntry(newParamValue, new Time(System.currentTimeMillis()))); int counter = 0; for (ParameterValueEntry value : values) { if (now - value.getCreationTime().getValue() < Math.round(refValue.getDeltaTime().getValue() * 1000)) { counter++;
/** * Returns a hash code for this object. * @return a hash code value for this object. */ public int hashCode() { int hash = 7; hash = 83 * hash + (azimuth != null ? azimuth.hashCode() : 0); hash = 83 * hash + (elevation != null ? elevation.hashCode() : 0); hash = 83 * hash + (prn != null ? prn.hashCode() : 0); hash = 83 * hash + (almanac != null ? almanac.hashCode() : 0); hash = 83 * hash + (ephemeris != null ? ephemeris.hashCode() : 0); hash = 83 * hash + (recentFix != null ? recentFix.hashCode() : 0); hash = 83 * hash + (svn != null ? svn.hashCode() : 0); return hash; }
public CheckLinkEvaluation(CheckResult lastCheckResult) { this.evaluationResults = new ArrayList<EvaluationResult>(); this.lastCheckResult = lastCheckResult; this.lastCheckResultTime = new Time(System.currentTimeMillis()); }
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; }
/** * Returns a hash code for this object. * @return a hash code value for this object. */ public int hashCode() { int hash = 7; hash = 83 * hash + (content != null ? content.hashCode() : 0); hash = 83 * hash + (creationDate != null ? creationDate.hashCode() : 0); hash = 83 * hash + (dimension != null ? dimension.hashCode() : 0); hash = 83 * hash + (format != null ? format.hashCode() : 0); return hash; }
if (! recentFix.equals(other.recentFix))
@Override public Time decodeTime() throws MALException { return new Time(sourceBuffer.getUnsignedLong()); }
public static FineTime timeToFineTime(final Time time) { return (time == null) ? null : new FineTime(HelperTime.fromMilliToNano(time.getValue())); }
if (! creationDate.equals(other.creationDate))
@Override public Time decodeTime() throws MALException { return new Time(sourceBuffer.getUnsignedLong()); }
@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); } }
private void addToParameterValuesListAndRegister(Long paramIdentityId) throws MALException, MALInteractionException { //add to list of monitored parameterValues List<ParameterValueEntry> values = new ArrayList<ParameterValueEntry>(); //get the first Values values.add(new ParameterValueEntry(paramManager.getParameterValue(paramIdentityId), new Time(System.currentTimeMillis()))); parameterValues.put(paramIdentityId, values); //parameter will be registered at the adapter Subscription sub = subscriptionKeys(new Identifier("" + paramIdentityId), new Identifier("*"), paramIdentityId, 0L, 0L); parameterStub.monitorValueRegister(sub, adapter); }
@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); } }
public static Time fineTimeToTime(final FineTime fineTime) { return (fineTime == null) ? null : new Time(HelperTime.fromNanoToMilli(fineTime.getValue())); }