コード例 #1
0
 /**
  * INTERNAL: Add element into the container.
  *
  * @param element java.lang.Object
  * @param container java.lang.Object
  * @return boolean indicating whether the container changed
  */
 protected boolean addInto(Object key, Object element, Object container) {
   try {
     ((IndirectList) container).addElement(element);
     return true;
   } catch (ClassCastException ex) {
     throw QueryException.cannotAddElement(element, container, ex);
   }
 }
コード例 #2
0
 /**
  * INTERNAL: Add element into a container which implements the Collection interface.
  *
  * @param element java.lang.Object
  * @param container java.lang.Object
  * @return boolean indicating whether the container changed
  */
 public void addIntoWithOrder(Vector indexes, Hashtable elements, Object container) {
   Object object = null;
   try {
     Enumeration indexEnum = indexes.elements();
     while (indexEnum.hasMoreElements()) {
       Integer index = (Integer) indexEnum.nextElement();
       object = elements.get(index);
       if (index.intValue() >= (sizeFor(container) - 1)) {
         ((IndirectList) container).addElement(object);
       } else {
         ((IndirectList) container).setElementAt(object, index.intValue());
       }
     }
   } catch (ClassCastException ex1) {
     throw QueryException.cannotAddElement(object, container, ex1);
   }
 }