Commit | Line | Data |
---|---|---|
f4baf640 GB |
1 | /******************************************************************************* |
2 | * Copyright (c) 2010, 2016 Ericsson, École Polytechnique de Montréal, and others | |
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 | ||
10 | package org.eclipse.tracecompass.internal.statesystem.core.backend.historytree; | |
11 | ||
12 | /** | |
13 | * A Core node is a first-level node of a History Tree which is not a leaf node. | |
14 | * | |
15 | * It extends HTNode by adding support for child nodes, and also extensions. | |
16 | * | |
17 | * @author Alexandre Montplaisir | |
18 | * @author Florian Wininger | |
19 | */ | |
20 | public abstract class ParentNode extends HTNode { | |
21 | ||
22 | /** | |
23 | * Initial constructor. Use this to initialize a new EMPTY node. | |
24 | * | |
25 | * @param config | |
26 | * Configuration of the History Tree | |
27 | * @param seqNumber | |
28 | * The (unique) sequence number assigned to this particular node | |
29 | * @param parentSeqNumber | |
30 | * The sequence number of this node's parent node | |
31 | * @param start | |
32 | * The earliest timestamp stored in this node | |
33 | */ | |
34 | public ParentNode(HTConfig config, int seqNumber, int parentSeqNumber, | |
35 | long start) { | |
36 | super(config, seqNumber, parentSeqNumber, start); | |
37 | } | |
38 | ||
39 | /** | |
40 | * Return the number of child nodes this node has. | |
41 | * | |
42 | * @return The number of child nodes | |
43 | */ | |
44 | public abstract int getNbChildren(); | |
45 | ||
46 | /** | |
47 | * Get the child node corresponding to the specified index | |
48 | * | |
49 | * @param index The index of the child to lookup | |
50 | * @return The child node | |
51 | */ | |
52 | public abstract int getChild(int index); | |
53 | ||
54 | /** | |
55 | * Get the latest (right-most) child node of this node. | |
56 | * | |
57 | * @return The latest child node | |
58 | */ | |
59 | public abstract int getLatestChild(); | |
60 | ||
61 | /** | |
62 | * Get the start time of the specified child node. | |
63 | * | |
64 | * @param index | |
65 | * The index of the child node | |
66 | * @return The start time of the that child node. | |
67 | */ | |
68 | public abstract long getChildStart(int index); | |
69 | ||
70 | /** | |
71 | * Get the start time of the latest (right-most) child node. | |
72 | * | |
73 | * @return The start time of the latest child | |
74 | */ | |
75 | public abstract long getLatestChildStart(); | |
76 | ||
77 | /** | |
78 | * Tell this node that it has a new child (Congrats!) | |
79 | * | |
80 | * @param childNode | |
81 | * The SHTNode object of the new child | |
82 | */ | |
83 | public abstract void linkNewChild(HTNode childNode); | |
84 | ||
85 | } |