* The interval component, which will be contained in a node of the History
* Tree.
*
- * @author alexmont
- *
+ * @author Alexandre Montplaisir
*/
-final class HTInterval implements ITmfStateInterval, Comparable<HTInterval> {
+public final class HTInterval implements ITmfStateInterval, Comparable<HTInterval> {
private static final String errMsg = "Invalid interval data. Maybe your file is corrupt?"; //$NON-NLS-1$
* Standard constructor
*
* @param intervalStart
+ * Start time of the interval
* @param intervalEnd
+ * End time of the interval
* @param attribute
+ * Attribute (quark) to which the state represented by this
+ * interval belongs
* @param value
+ * State value represented by this interval
* @throws TimeRangeException
+ * If the start time or end time are invalid
*/
- HTInterval(long intervalStart, long intervalEnd, int attribute,
+ public HTInterval(long intervalStart, long intervalEnd, int attribute,
TmfStateValue value) throws TimeRangeException {
if (intervalStart > intervalEnd) {
throw new TimeRangeException();
* reading it from disk (with {@link #readFrom}), we already know the size
* of the strings entry, so there is no need to call
* {@link #computeStringsEntrySize()} and do an extra copy.
- *
- * @param intervalStart
- * @param intervalEnd
- * @param attribute
- * @param value
- * @param size
- * @throws TimeRangeException
*/
private HTInterval(long intervalStart, long intervalEnd, int attribute,
TmfStateValue value, int size) throws TimeRangeException {
}
/**
- * Reader constructor. Builds the interval using an already-allocated
+ * Reader factory method. Builds the interval using an already-allocated
* ByteBuffer, which normally comes from a NIO FileChannel.
*
* @param buffer
* The ByteBuffer from which to read the information
+ * @return The interval object
* @throws IOException
+ * If there was an error reading from the buffer
*/
- final static HTInterval readFrom(ByteBuffer buffer) throws IOException {
+ public static final HTInterval readFrom(ByteBuffer buffer) throws IOException {
HTInterval interval;
long intervalStart, intervalEnd;
int attribute;
* StateValues.
* @return The size of the Strings Entry that was written, if any.
*/
- int writeInterval(ByteBuffer buffer, int endPosOfStringEntry) {
+ public int writeInterval(ByteBuffer buffer, int endPosOfStringEntry) {
buffer.putLong(start);
buffer.putLong(end);
buffer.putInt(attribute);
/**
* Total serialized size of this interval
*
- * @return
+ * @return The interval size
*/
- int getIntervalSize() {
+ public int getIntervalSize() {
return stringsEntrySize + HTNode.DATA_ENTRY_SIZE;
}