1 /*
2 * DefaultValueList.java
3 *
4 * Created on March 21, 2003, 3:08 PM
5 */
6
7 package com.mlw.vlh.impl;
8
9 import java.util.Iterator;
10 import java.util.List;
11 import java.util.NoSuchElementException;
12
13 import com.mlw.vlh.ValueList;
14 import com.mlw.vlh.ValueListInfo;
15
16 /*** Wrapper for a <CODE>List</CODE> and a <CODE>ValueListInfo</CODE> object.
17 * This is the Default implementation
18 *
19 * @author Matthew Wilson
20 */
21 public class DefaultValueList implements ValueList
22 {
23 private List list = null;
24 private ValueListInfo info = null;
25 private Iterator iter = null;
26
27 /*** Creates a new instance of DefaultValueList
28 */
29 public DefaultValueList(List list, ValueListInfo info)
30 {
31 this.list = list;
32 this.info = info;
33 }
34
35 /*** @see com.mlw.vlh.ValueList.getList()
36 */
37 public List getList()
38 {
39 return list;
40 }
41
42 /*** @see com.mlw.vlh.ValueList.getListInfo()
43 */
44 public ValueListInfo getValueListInfo()
45 {
46 return info;
47 }
48
49 /*** @see com.mlw.vlh.ValueList.hasNext()
50 */
51 public boolean hasNext()
52 {
53 if( iter==null && list!=null )
54 {
55 this.iter = list.iterator();
56 }
57
58 return (iter==null)?false:iter.hasNext();
59 }
60
61 /*** @see com.mlw.vlh.ValueList.next()
62 */
63 public Object next() throws NoSuchElementException
64 {
65 if( iter==null )
66 {
67 if( list!=null )
68 {
69 this.iter = list.iterator();
70 }
71 else
72 {
73 throw new NoSuchElementException();
74 }
75 }
76
77 return iter.next();
78 }
79
80 public void remove()
81 {
82 }
83 }
This page was automatically generated by Maven