Package java.util

Examples of java.util.Collection


   @SuppressWarnings("unchecked")
   public void toJSONScript(Object object, StringBuilder builder, int indentLevel) throws Exception
   {
      if (object instanceof Collection)
      {
         Collection collection = (Collection)object;
         Object[] array = new Object[collection.size()];
         collection.toArray(array);
         object = array;
      }

      appendIndentation(builder, indentLevel);
      builder.append('{').append('\n');
View Full Code Here


         return;
      }

      if (value instanceof Collection)
      {
         Collection collection = (Collection)value;
         Object[] array = new Object[collection.size()];
         collection.toArray(array);
         ArrayToJSONPlugin arrayToJSONPlugin = service_.getArrayToJSONPlugin();
         arrayToJSONPlugin.toJSONScript(array, builder, indentLevel);
         return;
      }
View Full Code Here

        Select select = new Select();
        select.addSymbol(new ElementSymbol("a")); //$NON-NLS-1$

        Expression constant1 = new Constant(new Integer(1000));
        Expression constant2 = new Constant(new Integer(5000));
        Collection constants = new ArrayList(2);
        constants.add(constant1);
        constants.add(constant2);
        Criteria crit = new SetCriteria(new ElementSymbol("b"), constants); //$NON-NLS-1$

        Query query = new Query();
        query.setSelect(select);
        query.setFrom(from);
View Full Code Here

        Select select = new Select();
        select.addSymbol(new ElementSymbol("a")); //$NON-NLS-1$

        Expression constant1 = new Constant(new Integer(1000));
        Expression constant2 = new Constant(new Integer(5000));
        Collection constants = new ArrayList(2);
        constants.add(constant1);
        constants.add(constant2);
        SetCriteria crit = new SetCriteria(new ElementSymbol("b"), constants); //$NON-NLS-1$
        crit.setNegated(true);
        Query query = new Query();
        query.setSelect(select);
        query.setFrom(from);
View Full Code Here

    @Test public void testCompoundNonJoinCriteriaInFromWithIsNull() {       
        helpTestCompoundNonJoinCriteria("e2 IS NULL", new IsNullCriteria(new ElementSymbol("e2")));     //$NON-NLS-1$ //$NON-NLS-2$
    }

    @Test public void testCompoundNonJoinCriteriaInFromUWithIN() {       
        Collection values = new ArrayList();
        values.add(new Constant(new Integer(0)));
        values.add(new Constant(new Integer(1)));
        PredicateCriteria crit = new SetCriteria(new ElementSymbol("e2"), values); //$NON-NLS-1$
        helpTestCompoundNonJoinCriteria("e2 IN (0, 1)", crit);     //$NON-NLS-1$
    }
View Full Code Here

   }

   public void testFindGroups() throws Exception
   {
      GroupHandler handler = organizationService.getGroupHandler();
      Collection allGroups = handler.findGroups(null);
      assertTrue(allGroups.size() > 0);
   }
View Full Code Here

   }

   public void testFindGroupById() throws Exception
   {
      GroupHandler uHandler = organizationService.getGroupHandler();
      Collection group = uHandler.findGroupsOfUser("root");
   }
View Full Code Here

    execute("select count(*) from x", new List[] {Arrays.asList(2)}); //$NON-NLS-1$
  }
 
  @Test public void testPrimaryKeyMetadata() throws Exception {
    execute("create local temporary table x (e1 string, e2 integer, primary key (e2))", new List[] {Arrays.asList(0)}); //$NON-NLS-1$
    Collection c = metadata.getUniqueKeysInGroup(metadata.getGroupID("x"));
    assertEquals(1, c.size());
    assertEquals(1, (metadata.getElementIDsInKey(c.iterator().next()).size()));
  }
View Full Code Here

        for (Map.Entry<GroupSymbol, List<Object>> entry : groupMap.entrySet()) {
            GroupSymbol group = entry.getKey();
            List<Object> elements = entry.getValue();
           
            // Look up keys
            Collection keys = null;
            if ((unique != null && unique) || unique == null) {
              keys = metadata.getUniqueKeysInGroup(group.getMetadataID());
            }
            if ((unique != null && !unique) || unique == null) {
              if (keys != null) {
                keys = new ArrayList<Object>(keys);
              } else {
                keys = new ArrayList<Object>(2);
              }
              keys.addAll(metadata.getIndexesInGroup(group.getMetadataID()));
            }
           
            if(keys != null && keys.size() > 0) {
                // For each key, get key elements
              for (Object key : keys) {
                    List keyElements = metadata.getElementIDsInKey(key);
                    if(elements.containsAll(keyElements)) {
                        // Used all elements of the key
View Full Code Here

        MappingDocument doc = new MappingDocument(false);
       
        loadDocumentProperties(doc, document.getDocumentElement());
       
        // now load all the children
        Collection mappingChildren = getChildren(document.getDocumentElement(), MappingNodeConstants.Tags.MAPPING_NODE_NAME);
        doc = (MappingDocument)recursiveLoadContents(mappingChildren, doc);
        return doc;
    }
View Full Code Here

TOP

Related Classes of java.util.Collection

Copyright © 2018 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.