- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRecordArray.java
More file actions
Latest commit
44 lines (40 loc) · 1.08 KB
/
Copy pathRecordArray.java
File metadata and controls
44 lines (40 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
importjava.util.ArrayList;
// -------------------------------------------------------------------------
/**
* Holds an ArrayList of Handles. Users can specify the
* position of the Handle in the array to access that Handle.
* Insertions and Removals can be made from the record array.
*
* @author Josh
* @version Aug 28, 2011
*/
publicclassRecordArray
{
privateArrayList<Handle> records;
/**
* Creates a RecordArray.
* @param size the size of the record array.
*/
publicRecordArray(intsize)
{
records = newArrayList<Handle>(size);
}
/**
* Returns the size of the RecordArray
* @return the capacity of the RecordArray
*/
publicintgetSize()
{
returnrecords.size();
}
/**
* Inserts a Handle at the specified position.
* @param position the position in the RecordArray to
* make the insertion
* @param theHandle the handle to be inserted into the RecordArray
*/
publicvoidinsert(intposition, HandletheHandle)
{
records.add(position, theHandle);
}
}