/*** * Returns the reference id as defined in RFC-1305, which is * a 32-bit integer whose value is dependent on several criteria. * * @return the reference id as defined in RFC-1305. */ @Override public int getReferenceId() { return getInt(REFERENCE_ID_INDEX); }
/** * Get NTP Timestamp at specified starting index. * * @param index index into data array * @return TimeStamp object for 64 bits starting at index */ private TimeStamp getTimestamp(int index) { return new TimeStamp(getLong(index)); }
/*** * Returns details of NTP packet as a string. * * @return details of NTP packet as a string. */ @Override public String toString() { return "[" + "version:" + getVersion() + ", mode:" + getMode() + ", poll:" + getPoll() + ", precision:" + getPrecision() + ", delay:" + getRootDelay() + ", dispersion(ms):" + getRootDispersionInMillisDouble() + ", id:" + getReferenceIdString() + ", xmitTime:" + getTransmitTimeStamp().toDateString() + " ]"; }
/*** * Returns root dispersion (as defined in RFC-1305) in milliseconds. * * @return root dispersion in milliseconds */ @Override public long getRootDispersionInMillis() { long l = getRootDispersion(); return (l * 1000) / 65536L; }
/*** * Return human-readable name of message mode type as described in * RFC 1305. * @return mode name as string. */ @Override public String getModeName() { return NtpUtils.getModeName(getMode()); }
/** * Return root delay as defined in RFC-1305 in milliseconds, which is * the total roundtrip delay to the primary reference source, in * seconds. Values can take positive and negative values, depending * on clock precision and skew. * * @return root delay in milliseconds */ @Override public double getRootDelayInMillisDouble() { double l = getRootDelay(); return l / 65.536; }
private String idAsHex() { return Integer.toHexString(getReferenceId()); }
/*** * Returns root dispersion (as defined in RFC-1305) in milliseconds * as double precision value. * * @return root dispersion in milliseconds */ @Override public double getRootDispersionInMillisDouble() { double l = getRootDispersion(); return l / 65.536; }
/*** * Return human-readable name of message mode type as described in * RFC 1305. * @return mode name as string. */ public String getModeName() { return NtpUtils.getModeName(getMode()); }
/*** * Return root delay as defined in RFC-1305 in milliseconds, which is * the total roundtrip delay to the primary reference source, in * seconds. Values can take positive and negative values, depending * on clock precision and skew. * * @return root delay in milliseconds */ public double getRootDelayInMillisDouble() { double l = getRootDelay(); return l / 65.536; }
private String idAsHex() { return Integer.toHexString(getReferenceId()); }
/*** * Returns details of NTP packet as a string. * * @return details of NTP packet as a string. */ public String toString() { return "[" + "version:" + getVersion() + ", mode:" + getMode() + ", poll:" + getPoll() + ", precision:" + getPrecision() + ", delay:" + getRootDelay() + ", dispersion(ms):" + getRootDispersionInMillisDouble() + ", id:" + getReferenceIdString() + ", xmitTime:" + getTransmitTimeStamp().toDateString() + " ]"; }
/*** * Return root delay as defined in RFC-1305, which is the total roundtrip delay * to the primary reference source, in seconds. Values can take positive and * negative values, depending on clock precision and skew. * * @return root delay as defined in RFC-1305. */ @Override public int getRootDelay() { return getInt(ROOT_DELAY_INDEX); }
/*** * Returns root dispersion (as defined in RFC-1305) in milliseconds. * * @return root dispersion in milliseconds */ public long getRootDispersionInMillis() { long l = getRootDispersion(); return (l * 1000) / 65536L; }
/*** * Get NTP Timestamp at specified starting index. * * @param index index into data array * @return TimeStamp object for 64 bits starting at index */ private TimeStamp getTimestamp(int index) { return new TimeStamp(getLong(index)); }
/*** * Return human-readable name of message mode type as described in * RFC 1305. * @return mode name as string. */ public String getModeName() { return NtpUtils.getModeName(getMode()); }
/*** * Return root delay as defined in RFC-1305 in milliseconds, which is * the total roundtrip delay to the primary reference source, in * seconds. Values can take positive and negative values, depending * on clock precision and skew. * * @return root delay in milliseconds */ public double getRootDelayInMillisDouble() { double l = getRootDelay(); return l / 65.536; }