| 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 | * Geneviève Bastien - Initial API and implementation |
| 11 | *******************************************************************************/ |
| 12 | |
| 13 | package org.eclipse.linuxtools.tmf.ui.viewers.tree; |
| 14 | |
| 15 | import java.util.List; |
| 16 | |
| 17 | /** |
| 18 | * Interface for an entry (row) in a TMF tree viewer |
| 19 | * |
| 20 | * @author Geneviève Bastien |
| 21 | * @since 3.0 |
| 22 | */ |
| 23 | public interface ITmfTreeViewerEntry { |
| 24 | |
| 25 | /** |
| 26 | * Returns the parent of this entry, or <code>null</code> if it has none. |
| 27 | * |
| 28 | * @return the parent element, or <code>null</code> if it has none |
| 29 | */ |
| 30 | ITmfTreeViewerEntry getParent(); |
| 31 | |
| 32 | /** |
| 33 | * Returns whether this entry has children. |
| 34 | * |
| 35 | * @return <code>true</code> if the given element has children, |
| 36 | * and <code>false</code> if it has no children |
| 37 | */ |
| 38 | boolean hasChildren(); |
| 39 | |
| 40 | /** |
| 41 | * Returns the child elements of this entry. |
| 42 | * |
| 43 | * @return an array of child elements |
| 44 | */ |
| 45 | List<? extends ITmfTreeViewerEntry> getChildren(); |
| 46 | |
| 47 | /** |
| 48 | * Returns the name of this entry. |
| 49 | * |
| 50 | * @return the entry name |
| 51 | */ |
| 52 | String getName(); |
| 53 | |
| 54 | } |