Commit | Line | Data |
---|---|---|
bb7f92ce FW |
1 | /******************************************************************************* |
2 | * Copyright (c) 2014 École Polytechnique de Montréal | |
3 | * | |
4 | * All rights reserved. This program and the accompanying materials are | |
5 | * made available under the terms of the Eclipse Public License v1.0 which | |
6 | * accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
8 | * | |
9 | * Contributors: | |
10 | * Florian Wininger - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
bcec0116 | 13 | package org.eclipse.linuxtools.internal.statesystem.core.backend.historytree; |
bb7f92ce FW |
14 | |
15 | import java.nio.ByteBuffer; | |
16 | ||
17 | /** | |
18 | * A Leaf node is a last-level node of a History Tree. | |
19 | * | |
20 | * A leaf node cannot have children, so it extends HTNode without adding | |
21 | * anything in particular. | |
22 | * | |
23 | * @author Florian Wininger | |
24 | */ | |
25 | public final class LeafNode extends HTNode { | |
26 | ||
27 | /** | |
28 | * Initial constructor. Use this to initialize a new EMPTY node. | |
29 | * | |
30 | * @param config | |
31 | * Configuration of the History Tree | |
32 | * @param seqNumber | |
33 | * The (unique) sequence number assigned to this particular node | |
34 | * @param parentSeqNumber | |
35 | * The sequence number of this node's parent node | |
36 | * @param start | |
37 | * The earliest timestamp stored in this node | |
38 | */ | |
39 | public LeafNode(HTConfig config, int seqNumber, int parentSeqNumber, | |
40 | long start) { | |
41 | super(config, seqNumber, parentSeqNumber, start); | |
42 | } | |
43 | ||
44 | @Override | |
45 | protected void readSpecificHeader(ByteBuffer buffer) { | |
46 | /* No specific header part */ | |
47 | } | |
48 | ||
49 | @Override | |
50 | protected void writeSpecificHeader(ByteBuffer buffer) { | |
51 | /* No specific header part */ | |
52 | } | |
53 | ||
54 | @Override | |
55 | public NodeType getNodeType() { | |
56 | return NodeType.LEAF; | |
57 | } | |
58 | ||
59 | @Override | |
60 | protected int getSpecificHeaderSize() { | |
61 | /* Empty */ | |
62 | return 0; | |
63 | } | |
64 | ||
65 | @Override | |
66 | public String toStringSpecific() { | |
67 | /* Only used for debugging, shouldn't be externalized */ | |
68 | return "Leaf Node, "; //$NON-NLS-1$; | |
69 | } | |
70 | ||
71 | } |