1 24 package org.archive.crawler.settings; 25 26 30 public class DoubleList extends ListType<Double > { 31 32 private static final long serialVersionUID = -5793937164778552546L; 33 34 40 public DoubleList(String name, String description) { 41 super(name, description); 42 } 43 44 52 public DoubleList(String name, String description, DoubleList l) { 53 super(name, description); 54 addAll(l); 55 } 56 57 65 public DoubleList(String name, String description, Double [] l) { 66 super(name, description); 67 addAll(l); 68 } 69 70 78 public DoubleList(String name, String description, double[] l) { 79 super(name, description); 80 addAll(l); 81 } 82 83 88 public void add(int index, Double element) { 89 super.add(index, element); 90 } 91 92 97 public void add(int index, double element) { 98 super.add(index, new Double (element)); 99 } 100 101 105 public void add(Double element) { 106 super.add(element); 107 } 108 109 113 public void add(double element) { 114 super.add(new Double (element)); 115 } 116 117 126 public void addAll(DoubleList l) { 127 super.addAll(l); 128 } 129 130 135 public void addAll(Double [] l) { 136 for (int i = 0; i < l.length; i++) { 137 add(l[i]); 138 } 139 } 140 141 146 public void addAll(double[] l) { 147 for (int i = 0; i < l.length; i++) { 148 add(l[i]); 149 } 150 } 151 152 159 public Double set(int index, Double element) { 160 return (Double ) super.set(index, element); 161 } 162 163 173 public Double checkType(Object element) throws ClassCastException { 174 if (element instanceof Double ) { 175 return (Double )element; 176 } else { 177 return (Double ) 178 SettingsHandler.StringToType( 179 (String ) element, 180 SettingsHandler.DOUBLE); 181 } 182 } 183 } 184 | Popular Tags |