예제 #1
0
 /**
  * Factory method to create a SetList using the supplied list to retain order.
  * <p>
  * If the list contains duplicates, these are removed (first indexed one kept).
  * A <code>HashSet</code> is used for the set behaviour.
  *
  * @param list  the list to decorate, must not be null
  * @throws IllegalArgumentException if list is null
  */
 public static SetUniqueList decorate(java.util.List <Object> list)
 {
     if (list == null)
     {
         throw new java.lang.IllegalArgumentException("List must not be null");
     }
     if (list.isEmpty())
     {
         return(new SetUniqueList(list, new java.util.HashSet <Object>()));
     }
     else
     {
         java.util.List <Object> temp = new java.util.ArrayList <Object>(list);
         list.clear();
         SetUniqueList sl = new SetUniqueList(list, new java.util.HashSet <Object>());
         sl.addAll(temp);
         return(sl);
     }
 }
예제 #2
0
        /** {@inheritDoc} */
        public override void finish() //throws IOException
        {
            if (finished)
            {
                throw new java.io.IOException("This archive has already been finished");
            }

            if (entry != null)
            {
                throw new java.io.IOException("This archives contains unclosed entries.");
            }

            cdOffset = written;
            for (java.util.Iterator <ZipArchiveEntry> i = entries.iterator(); i.hasNext();)
            {
                writeCentralFileHeader((ZipArchiveEntry)i.next());
            }
            cdLength = written - cdOffset;
            writeCentralDirectoryEnd();
            offsets.clear();
            entries.clear();
            finished = true;
        }
예제 #3
0
 /// <summary> Flushes the container
 /// </summary>
 public virtual void  removeAllPrimitives()
 {
     lines.clear();
     shapes.clear();
     repaint();
 }