1
|
/*******************************************************************************
|
2
|
* Copyright (c) 2003, 2010 IBM Corporation and others.
|
3
|
* All rights reserved. This program and the accompanying materials
|
4
|
* are made available under the terms of the Eclipse Public License v1.0
|
5
|
* which accompanies this distribution, and is available at
|
6
|
* http://www.eclipse.org/legal/epl-v10.html
|
7
|
*
|
8
|
* Contributors:
|
9
|
* IBM Corporation - initial API and implementation
|
10
|
*******************************************************************************/
|
11
|
package org.eclipse.draw2d.graph;
|
12
|
|
13
|
import java.util.ArrayList;
|
14
|
|
15
|
/**
|
16
|
* For internal use only. A list of lists.
|
17
|
*
|
18
|
* @author hudsonr
|
19
|
* @since 2.1.2
|
20
|
*/
|
21
|
public final class RankList {
|
22
|
|
23
|
ArrayList ranks = new ArrayList();
|
24
|
|
25
|
/**
|
26
|
* Returns the specified rank.
|
27
|
*
|
28
|
* @param rank
|
29
|
* the row
|
30
|
* @return the rank
|
31
|
*/
|
32
|
public Rank getRank(int rank) {
|
33
|
while (ranks.size() <= rank)
|
34
|
ranks.add(new Rank());
|
35
|
return (Rank) ranks.get(rank);
|
36
|
}
|
37
|
|
38
|
/**
|
39
|
* Returns the total number or ranks.
|
40
|
*
|
41
|
* @return the total number of ranks
|
42
|
*/
|
43
|
public int size() {
|
44
|
return ranks.size();
|
45
|
}
|
46
|
|
47
|
}
|