Examples of HashSet


Examples of java.util.HashSet

                atLeastOneFits = true;
            }

//          compose cells array list for subsequent code
            cells.clear();
            Set opt = new HashSet();
            iterator = rows.iterator();
            while (iterator.hasNext()) {
                ArrayList row = (ArrayList) iterator.next();
               
                Iterator cellIterator = row.iterator();
                while (cellIterator.hasNext()) {
                    cell = (PdfCell) cellIterator.next();
                   
                    if (!opt.contains(cell)) {
                        cells.add(cell);
                        opt.add(cell);
                    }
                }
            }
           
      // we paint the graphics of the table after looping through all the cells
View Full Code Here

Examples of java.util.HashSet

    this.config = config;
  }

  @Override
  public Set<K> keys() {
    HashSet keys = new HashSet();
    Node<K, V> node = getRootNode();
    Set<Node<K, V>> children = node.getChildren();
    for (Node<K, V> child:children) {
      keys.addAll(child.getData().keySet());
    }
    return keys;
  }
View Full Code Here

Examples of java.util.HashSet

    return (V)child.put(key, value);
  }
 
  @Override
  public Set<K> keys() {
    HashSet keys = new HashSet();
    Node<K, V> node = getRootNode();
    Set<Node<K, V>> children = node.getChildren();
    for (Node<K, V> child:children) {
      for (K key:child.getData().keySet()) {
        if ((key instanceof String) && (key.equals(ExpirationAlgorithmConfig.EXPIRATION_KEY))) {
          continue;
        }
        keys.add(key);
      }
    }
    return keys;
 
View Full Code Here

Examples of java.util.HashSet

    public TestCollectorVisitor(String name) {
        super(name);
    }

    public Set getStringSet(Collection objs) {
        Set strings = new HashSet();
       
        Iterator iter = objs.iterator();
        while(iter.hasNext()) {
            Object obj = iter.next();
            if(obj == null) {
                strings.add(null);
            } else {
                strings.add(obj.toString());
            }
        }
       
        return strings;
    }
View Full Code Here

Examples of java.util.HashSet

        return strings;
    }
   
    public void helpTestCollection(LanguageObject obj, Class type, String[] objects) {
        Set actualObjects = getStringSet(CollectorVisitor.collectObjects(type, obj));
        Set expectedObjects = new HashSet(Arrays.asList(objects));
       
        assertEquals("Did not get expected objects", expectedObjects, actualObjects); //$NON-NLS-1$
    }
View Full Code Here

Examples of java.util.HashSet

    public void helpTestElementsUsedByGroups(LanguageObject obj, String[] elements, String[] groups) {
        Set actualElements = getStringSet(CollectorVisitor.collectElements(obj));
        Set actualGroups = getStringSet(CollectorVisitor.collectGroupsUsedByElements(obj));
       
        Set expectedElements = new HashSet(Arrays.asList(elements));
        Set expectedGroups = new HashSet(Arrays.asList(groups));
       
        assertEquals("Did not get expected elements", expectedElements, actualElements); //$NON-NLS-1$
        assertEquals("Did not get expected groups", expectedGroups, actualGroups);         //$NON-NLS-1$
    }
View Full Code Here

Examples of java.util.HashSet

      ServiceRegistration registration = (ServiceRegistration) registeredServices.get(objName);
      registration.setProperties(registrationProperties);
      return;
    }
   
    Set serviceNames = new HashSet();
    computeOSGiServiceNames(obj.getClass(), obj, serviceNames);
    ServiceRegistration registration = Activator.context.registerService((String[]) serviceNames.toArray(new String[serviceNames.size()]), obj, registrationProperties);
    registeredServices.put(objName, registration);
  }
View Full Code Here

Examples of java.util.HashSet

  public Set queryNames(String objectName) throws MalformedObjectNameException {
    if (mxserver == null) {
      return null;
    }
    Set objectNames = mxserver.queryNames(new ObjectName(objectName), null);
    Set names = new HashSet();
    for (Iterator iterator = objectNames.iterator(); iterator.hasNext();) {
      ObjectName objName = (ObjectName) iterator.next();
      names.add(objName.getCanonicalName());
    }
    return names;
  }
View Full Code Here

Examples of java.util.HashSet

     * Obtain list of connectors that failed. 
     * @return List of connectors that failed - List contains String names
     */
    public Collection getFailedConnectors() {
        if(this.failures != null) {
            return new HashSet(this.failures.keySet());
        }
        return Collections.EMPTY_SET;
    }
View Full Code Here

Examples of java.util.HashSet

   * defaults of the properties, the third Map the defaults of the second Map, and so on...
   * @return true all keys are present, false otherwise
   */
    private static final boolean verifyAllPropsPresent(Properties props, List chainOfMappings){
      Enumeration e = props.propertyNames();
    HashSet propNames = new HashSet();
      while (e.hasMoreElements()) {
            propNames.add( e.nextElement());
      }
     
      HashSet testNames = new HashSet();
        Iterator i = chainOfMappings.iterator();
        while (i.hasNext()) {
            Map aMapping = (Map) i.next();
      testNames.addAll(aMapping.keySet());
        }     
    return propNames.containsAll(testNames);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.