*/
public final class CoreNode extends HTNode {
- /** Number of bytes in a int */
- private static final int SIZE_INT = 4;
-
- /** Number of bytes in a long */
- private static final int SIZE_LONG = 8;
-
/** Nb. of children this node has */
private int nbChildren;
protected int getSpecificHeaderSize() {
int maxChildren = getConfig().getMaxChildren();
int specificSize =
- SIZE_INT /* 1x int (extension node) */
- + SIZE_INT /* 1x int (nbChildren) */
+ Integer.BYTES /* 1x int (extension node) */
+ + Integer.BYTES /* 1x int (nbChildren) */
/* MAX_NB * int ('children' table) */
- + SIZE_INT * maxChildren
+ + Integer.BYTES * maxChildren
/* MAX_NB * Timevalue ('childStart' table) */
- + SIZE_LONG * maxChildren;
+ + Long.BYTES * maxChildren;
return specificSize;
}
* 1 - byte (done or not)
* </pre>
*/
- private static final int COMMON_HEADER_SIZE = 34;
+ private static final int COMMON_HEADER_SIZE = Byte.BYTES
+ + 2 * Long.BYTES
+ + 4 * Integer.BYTES
+ + Byte.BYTES;
// ------------------------------------------------------------------------
// Attributes
* null anyway).
*/
ITmfStateInterval interval = fIntervals.get(i);
- if (interval.getStartTime() <= t &&
+ if (t >= interval.getStartTime() &&
interval.getAttribute() < stateInfo.size()) {
stateInfo.set(interval.getAttribute(), interval);
}