Revision 1882 org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/tools/util/UnmodifiableBasicList.java

View differences:

UnmodifiableBasicList.java
1 1

  
2 2
package org.gvsig.tools.util;
3 3

  
4
import java.util.Collections;
5
import java.util.Iterator;
4 6
import java.util.List;
5 7

  
6 8
/**
7 9
 *
8 10
 * @author jjdelcerro
9 11
 */
10
public interface UnmodifiableBasicList<T> extends GetItem<T>, Size, Iterable<T> {
12
public interface UnmodifiableBasicList<V> extends UnmodifiableBasicCollection<V>, GetItem<V> {
11 13
    
12
    public boolean isEmpty();
14
    public List<V> toList();
13 15
    
14
    public List<T> toList();
16
    public final UnmodifiableBasicList EMPTY_UNMODIFIABLEBASICLIST = new UnmodifiableBasicList() {
17
        @Override
18
        public boolean isEmpty() {
19
            return true;
20
        }
21

  
22
        @Override
23
        public List toList() {
24
            return Collections.EMPTY_LIST;
25
        }
26

  
27
        @Override
28
        public Object get(int position) {
29
            throw new IndexOutOfBoundsException();
30
        }
31

  
32
        @Override
33
        public int size() {
34
            return 0;
35
        }
36

  
37
        @Override
38
        public Iterator iterator() {
39
            return Collections.EMPTY_LIST.iterator();
40
        }
41
    };
42
    
43
    
15 44
}

Also available in: Unified diff