svn-gvsig-desktop / trunk / libraries / libGDBMS / src / com / hardcode / gdbms / engine / data / indexes / VariableMemoryIndexSet.java @ 466
History | View | Annotate | Download (1.51 KB)
1 |
/* Generated by Together */
|
---|---|
2 |
package com.hardcode.gdbms.engine.data.indexes; |
3 |
|
4 |
|
5 |
|
6 |
/**
|
7 |
* Implementaci?n de un conjunto de ?ndices en memoria, aunque puede
|
8 |
* haber un conjunto de Long.MAXVALUE ?ndices, en memoria, el tama?o
|
9 |
* m?ximo es de Integer.MAXVALUE. Otras implementaciones de VariableIndexSet
|
10 |
* en memoria pueden no tener esta restricci?n
|
11 |
*
|
12 |
* @author Fernando Gonz?lez Cort?s
|
13 |
*/
|
14 |
public class VariableMemoryIndexSet extends MemoryIndexSet implements VariableIndexSet { |
15 |
private int count = 0; |
16 |
/**
|
17 |
* @see com.hardcode.gdbms.engine.data.indexes.VariableIndexSet#open(java.io.File)
|
18 |
*/
|
19 |
public void open() { |
20 |
} |
21 |
/**
|
22 |
* Creates a new MemoryIndexSet object.
|
23 |
*
|
24 |
* @param initialCapacity Capacidad inicial del conjunto de ?ndices. Deber?
|
25 |
* de ser la capacidad m?xima que pueda llegar a tener el conjunto
|
26 |
*/
|
27 |
public VariableMemoryIndexSet(int initialCapacity) { |
28 |
indexes = new long[initialCapacity]; |
29 |
} |
30 |
|
31 |
/**
|
32 |
* @see com.hardcode.gdbms.engine.data.indexes.VariableIndexSet#indexSetComplete
|
33 |
*/
|
34 |
public void indexSetComplete() { |
35 |
long[] aux = new long[count]; |
36 |
System.arraycopy(indexes, 0, aux, 0, count); |
37 |
indexes = aux; |
38 |
} |
39 |
|
40 |
/**
|
41 |
* @see com.hardcode.gdbms.engine.data.indexes.VariableIndexSet#addIndex(long)
|
42 |
*/
|
43 |
public void addIndex(long index) { |
44 |
indexes[count] = index; |
45 |
count++; |
46 |
} |
47 |
|
48 |
/**
|
49 |
* @see com.hardcode.gdbms.engine.data.indexes.VariableIndexSet#getIndexCount(long)
|
50 |
*/
|
51 |
public long getIndexCount() { |
52 |
return count;
|
53 |
} |
54 |
|
55 |
} |