root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / LayerPath.java @ 213
History | View | Annotate | Download (1.11 KB)
1 |
/* Generated by Together */
|
---|---|
2 |
package com.iver.cit.gvsig.fmap; |
3 |
|
4 |
import java.util.ArrayList; |
5 |
|
6 |
|
7 |
/**
|
8 |
* Representa una capa en el array de capas
|
9 |
*/
|
10 |
public class LayerPath { |
11 |
private ArrayList path = new ArrayList(3); |
12 |
|
13 |
/**
|
14 |
* Crea un nuevo LayerPath vac?o
|
15 |
*/
|
16 |
public LayerPath() {
|
17 |
} |
18 |
|
19 |
/**
|
20 |
* Crea un nuevo LayerPath que referencia a un hijo
|
21 |
* del elemento referenciado por el LayerPath que se
|
22 |
* pasa como par?metro
|
23 |
*
|
24 |
* @param parent
|
25 |
* @param index DOCUMENT ME!
|
26 |
*/
|
27 |
public LayerPath(LayerPath parent, int index) { |
28 |
path = new ArrayList(parent.path); |
29 |
path.add(new Integer(index)); |
30 |
} |
31 |
|
32 |
/**
|
33 |
* Elimina el primer elemento del path y devuelve el ?ndice de la FLayer
|
34 |
* que representa
|
35 |
*
|
36 |
* @return DOCUMENT ME!
|
37 |
*/
|
38 |
public int popIndex() { |
39 |
return ((Integer) path.remove(0)).intValue(); |
40 |
} |
41 |
|
42 |
/**
|
43 |
* Obtiene el n?mero de elementos del path
|
44 |
*
|
45 |
* @return DOCUMENT ME!
|
46 |
*/
|
47 |
public boolean isEmpty() { |
48 |
return path.isEmpty();
|
49 |
} |
50 |
|
51 |
/**
|
52 |
* Devuelve el ?ndice del ?ltimo elemento del path
|
53 |
*
|
54 |
* @return DOCUMENT ME!
|
55 |
*/
|
56 |
public int getLastIndex() { |
57 |
return ((Integer) path.get(path.size() - 1)).intValue(); |
58 |
} |
59 |
} |