home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / java / util / Collections$SingletonList.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  900 b   |  28 lines

  1. package java.util;
  2.  
  3. import java.io.Serializable;
  4.  
  5. class Collections$SingletonList extends AbstractList implements Serializable {
  6.    private final Object element;
  7.  
  8.    Collections$SingletonList(Object var1) {
  9.       this.element = var1;
  10.    }
  11.  
  12.    public int size() {
  13.       return 1;
  14.    }
  15.  
  16.    public boolean contains(Object var1) {
  17.       return Collections.access$100(var1, this.element);
  18.    }
  19.  
  20.    public Object get(int var1) {
  21.       if (var1 != 0) {
  22.          throw new IndexOutOfBoundsException("Index: " + var1 + ", Size: 1");
  23.       } else {
  24.          return this.element;
  25.       }
  26.    }
  27. }
  28.