MCPcopy Create free account
hub / github.com/OpenTSDB/opentsdb / doubleValue

Method doubleValue

src/core/BatchedDataPoints.java:452–468  ·  view source on GitHub ↗
(final int i)

Source from the content-addressed store, hash-verified

450 }
451
452 @Override
453 public double doubleValue(final int i) {
454 checkIndex(i);
455 // compute the proper value and qualifier offsets
456 int v_offset = 0;
457 int q_offset = 0;
458 for (int j = 0; j < i; j++) {
459 v_offset += Internal.getValueLengthFromQualifier(batched_qualifier, q_offset);
460 q_offset += Internal.getQualifierLength(batched_qualifier, q_offset);
461 }
462
463 if (!isInteger(i, q_offset)) {
464 final short flags = Internal.getFlagsFromQualifier(batched_qualifier, q_offset);
465 return Internal.extractFloatingPointValue(batched_value, v_offset, (byte)flags);
466 }
467 throw new ClassCastException("value #" + i + " is not a float in " + this);
468 }
469
470 /**
471 * Returns a human readable string representation of the object.

Callers

nothing calls this directly

Calls 6

checkIndexMethod · 0.95
getQualifierLengthMethod · 0.95
isIntegerMethod · 0.95
getFlagsFromQualifierMethod · 0.95

Tested by

no test coverage detected