コード例 #1
0
 /**
  * @return clone of the current instance
  * @author Klaus Meffert
  * @since 2.3
  */
 public Object clone() {
   try {
     final KeyedValues clone = (KeyedValues) super.clone();
     clone.m_data = Collections.synchronizedList(new ArrayList());
     final Iterator iterator = m_data.iterator();
     while (iterator.hasNext()) {
       final KeyedValue kv = (KeyedValue) iterator.next();
       clone.m_data.add(kv.clone());
     }
     return clone;
   } catch (CloneNotSupportedException cex) {
     throw new CloneException(cex);
   }
 }
コード例 #2
0
 /**
  * Creates a new collection (initially empty).
  *
  * @author Klaus Meffert
  * @since 2.3
  */
 public KeyedValues() {
   m_data = Collections.synchronizedList(new ArrayList());
 }