Package java.util

Examples of java.util.Iterator


    Directory exif = metadata.getDirectory(ExifDirectory.class);
    int orie = exif.getInt(ExifDirectory.TAG_ORIENTATION);
    if(orie!=1)
      System.out.println(jpegFile.getName()+":"+orie);
   
      Iterator tags = exif.getTagIterator();
      while (tags.hasNext()) {
          Tag tag = (Tag)tags.next();
          // use Tag.toString()
          System.out.println(tag);
      }
  }
View Full Code Here


    if(user != null){
      Query q = getSession().getNamedQuery("USER_PERMS");
      q.setInteger(0, user.getId());
      perms = q.list();
    }
    Iterator iter = catalogs.iterator();
    while (iter.hasNext()) {
      CatalogBean catalog = (CatalogBean) iter.next();
      // ���ɷ����κ��˶����Է���
      if (catalog.getType() == CatalogBean.TYPE_FREE)
        continue;
      int role = getUserRoleInCatalog(perms, catalog, user);
      if (!maintain) {// �����
        if (catalog.getType() != CatalogBean.TYPE_GENERAL) {
          if (role < 0)
            iter.remove();
        }
      } else {// д�ռ���
        if (catalog.getType() == CatalogBean.TYPE_GENERAL)
          iter.remove();
        else {
          if (role != CatalogPermBean.ROLE_BLOG)
            iter.remove();
        }
      }
    }
    return catalogs;
  }
View Full Code Here

    return out();
  }
 
  protected void assignAll(Object bean) {
    Map p = getBeanProperties(bean);
    Iterator i = p.keySet().iterator();
    while (i.hasNext()) {
      String key = (String) i.next();
      assign(key.toUpperCase(), "" + p.get(key));
    }
  }
View Full Code Here

    public void testIterator() {
        assertTrue(makeEmptyIterator() instanceof Unmodifiable);
    }
   
    public void testDecorateFactory() {
        Iterator it = makeFullIterator();
        assertSame(it, UnmodifiableIterator.decorate(it));
       
        it = testList.iterator();
        assertTrue(it != UnmodifiableIterator.decorate(it));
       
View Full Code Here

  // PROTECTED INSTANCE METHODS
  // =========================================================================

  protected boolean checkAgainstPatterns( String name )
  {
    Iterator iterator      = null ;
    StringPattern pattern  = null ;
   
    iterator = this.getStringPatterns().iterator() ;
    while ( iterator.hasNext() )
    {
      pattern = (StringPattern)iterator.next() ;
      if ( pattern.matches( name ) )
        return true ;
    } // while
   
    return false ; // No pattern matched
View Full Code Here

        if (pos != -1) {
            String extension = filename.substring(pos + 1, filename.length()).toLowerCase();

            // Find a writer for that file suffix
            ImageWriter writer = null;
            Iterator iter = ImageIO.getImageWritersBySuffix(extension);
            if (iter.hasNext())
                writer = (ImageWriter)iter.next();
            if (writer != null) {
                ImageOutputStream ios = null;
                try {
                    // Prepare output file
                    File file = new File(filename);
View Full Code Here

     * @see helma.image.ImageGenerator#write(helma.image.ImageWrapper, java.io.OutputStream, java.lang.String, float, boolean)
     */
    public void write(ImageWrapper wrapper, OutputStream out, String mimeType, float quality, boolean alpha) throws IOException {
            // Find a writer for that type
        ImageWriter writer = null;
        Iterator iter = ImageIO.getImageWritersByMIMEType(mimeType);
        if (iter.hasNext())
            writer = (ImageWriter)iter.next();
        if (writer != null) {
            ImageOutputStream ios = null;
            try {
                ios = ImageIO.createImageOutputStream(out);
                writer.setOutput(ios);
View Full Code Here

 
  public static String convertListToString(List list) {
   
    StringBuffer result = new StringBuffer();
    String separator = "";
    Iterator iter = list.iterator();
    while(iter.hasNext()) {
      String line = iter.next().toString();
      result.append(separator);
      result.append(line);
      separator = "\n";
    }
   
View Full Code Here

            DirCallback dirCallback = new DirCallback();
            ftp.dirDetails(".", dirCallback);
           
            if (dirCallback.getFiles().size() != files.length) {
                log.debug("Callback=" + dirCallback.getFiles().size() + ", listing=" + files.length);
                Iterator i = dirCallback.getFiles().keySet().iterator();
                while (i.hasNext()) {
                    log.debug((String)i.next());
                }
                log.debug("Listing=" + files.length);
                for (int j = 0; j < files.length; j++)
                    log.debug(files[j].getName());
                fail("Mismatch in listing length");
            }
           
            log.debug("Listing lengths match!");
           
            boolean allFound = true;
            for (int i = 0; i < files.length; i++) {
                if (dirCallback.getFiles().get(files[i].getName()) == null) {
                    log.debug("Failed to find " + files[i].getName());
                    allFound = false;
                }
            }
           
            if (!allFound) {
                Iterator i = dirCallback.getFiles().values().iterator();
                while (i.hasNext()) {
                    log.debug(((FTPFile)i.next()).getName());
                }
                fail("Failed to find all files");
            }
           
            ftp.quit();
View Full Code Here

      IndividualList employeeList = new IndividualList();

      // ok, now that we have the results from the database,
      // we need to generate a DisplayList object to pass
      // to the List View code (List.jsp)
      Iterator iter = sqlResults.iterator();

      while (iter.hasNext()) {
        HashMap sqlRow = (HashMap)iter.next();

        String individualName = (String)sqlRow.get("Name");
        int individualID = ((Number)sqlRow.get("IndividualID")).intValue();

        IntMember individualIDfield = new IntMember("IndividualID", individualID, 10, "", 'T', false, 10);
View Full Code Here

TOP

Related Classes of java.util.Iterator

Copyright © 2015 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.