lcsim-contrib/src/main/java/org/lcsim/contrib/onoprien/util
diff -u -r1.2 -r1.3
--- WeightedList.java 9 Feb 2009 19:43:13 -0000 1.2
+++ WeightedList.java 11 Feb 2009 23:31:42 -0000 1.3
@@ -12,7 +12,7 @@
* memory and speed to an object of <tt>ArrayList</tt> type.
*
* @author D. Onoprienko
- * @version $Id: WeightedList.java,v 1.2 2009/02/09 19:43:13 onoprien Exp $
+ * @version $Id: WeightedList.java,v 1.3 2009/02/11 23:31:42 onoprien Exp $
*/
public class WeightedList<E> extends ArrayList<E> {
@@ -63,7 +63,7 @@
/** Returns weight of the element with the specified index. */
public double getWeight(int index) {
- return _w[index];
+ return (_w == null) ? 1. : _w[index];
}
/** Returns weight of the specified element. */