Package org.apache.commons.collections.set

Examples of org.apache.commons.collections.set.ListOrderedSet


     * @param resultSet The result set
     * @return The columns
     */
    private Set getColumnsInResultSet(ResultSet resultSet) throws SQLException
    {
        ListOrderedSet    result   = new ListOrderedSet();
        ResultSetMetaData metaData = resultSet.getMetaData();

        for (int idx = 1; idx <= metaData.getColumnCount(); idx++)
        {
            result.add(metaData.getColumnName(idx).toUpperCase());
        }
       
        return result;
    }
View Full Code Here


     *
     * @return a set containing the sections.
     */
    public Set getSections()
    {
        Set sections = new ListOrderedSet();
        boolean globalSection = false;
        boolean inSection = false;

        for (Iterator it = getRootNode().getChildren().iterator(); it.hasNext();)
        {
            ConfigurationNode node = (ConfigurationNode) it.next();
            if (isSectionNode(node))
            {
                inSection = true;
                sections.add(node.getName());
            }
            else
            {
                if (!inSection && !globalSection)
                {
                    globalSection = true;
                    sections.add(null);
                }
            }
        }

        return sections;
View Full Code Here

        /**
         * Default constructor.
         */
        public DefinedKeysVisitor()
        {
            keyList = new ListOrderedSet();
            parentKeys = new Stack();
        }
View Full Code Here

  private String applicationIcon;

  @SuppressWarnings("unchecked")
  public UIPage() {
    scriptFiles = SetUniqueList.decorate(new ArrayList());
    scriptBlocks = new ListOrderedSet();
    styleFiles = new ListOrderedSet();
    styleFiles.add(DEFAULT_STYLE);
    styleBlocks = new ListOrderedSet();
    onloadScripts = new ListOrderedSet();
    onunloadScripts = new ListOrderedSet();
    onexitScripts = new ListOrderedSet();
    onsubmitScripts = new ListOrderedSet();
    popups = new ListOrderedSet();
  }
View Full Code Here

     *
     * @param qualifierString to be parsed
     * @return List of parameter names.
     */
    private Set parseQualifier(String qualifierString) {
        Set result = new ListOrderedSet();
        Pattern pattern = Pattern.compile("\\$[\\w]+");
        Matcher matcher = pattern.matcher(qualifierString);
        while(matcher.find()) {
            String name = matcher.group();
            result.add(NameConverter.underscoredToJava(name.substring(1), false));
        }
       
        return result;
    }
View Full Code Here

     * @param princ
     * @return all Group principals the specified <code>princ</code> is member of
     * including inherited membership.
     */
    private Set collectGroupMembership(Principal princ) {
        Set membership = new ListOrderedSet();
            try {
                Authorizable auth = userManager.getAuthorizable(princ);
                if (auth != null) {
                    addToCache(princ);
                    Iterator itr = auth.memberOf();
                    while (itr.hasNext()) {
                        Group group = (Group) itr.next();
                        Principal gp = group.getPrincipal();
                        addToCache(gp);
                        membership.add(gp);
                    }
                } else {
                    log.debug("Cannot find authorizable for principal " + princ.getName());
                }
            } catch (RepositoryException e) {
View Full Code Here

     * principal and all groups it is member of.
     */
    protected Set getPrincipals() {
        // use ListOrderedSet instead of Hashset in order to maintain the order
        // of principals (as in the Subject).
        Set principals = new ListOrderedSet();
        principals.add(principal);
        Iterator groups = principalProvider.getGroupMembership(principal);
        while (groups.hasNext()) {
            principals.add(groups.next());
        }
        return principals;
    }
View Full Code Here

  public static final String MARKUP = SEPARATOR + "markup" + SEPARATOR;

  private ListOrderedSet classes;

  public StyleClasses() {
    classes = new ListOrderedSet();
  }
View Full Code Here

     * @return the Fields to be selected
     */
    protected FieldDescriptor[] buildFieldsForSelect(ClassDescriptor cld)
    {
        DescriptorRepository repository = cld.getRepository();
        Set fields = new ListOrderedSet();   // keep the order of the fields
       
        // add Standard Fields
        // MBAIRD: if the object being queried on has multiple classes mapped to the table,
        // then we will get all the fields that are a unique set across all those classes so if we need to
        // we can materialize an extent
        FieldDescriptor fds[] = repository.getFieldDescriptorsForMultiMappedTable(cld);
        for (int i = 0; i < fds.length; i++)
        {
            fields.add(fds[i]);
        }

        // add inherited Fields. This is important when querying for a class having a super-reference
        fds = cld.getFieldDescriptor(true);
        for (int i = 0; i < fds.length; i++)
        {
            fields.add(fds[i]);
        }

        // add Fields of joined subclasses
        Class[] multiJoinedClasses = repository.getSubClassesMultipleJoinedTables(cld, true);
        for (int c = 0; c < multiJoinedClasses.length; c++)
        {
            ClassDescriptor subCld = repository.getDescriptorFor(multiJoinedClasses[c]);
            fds = subCld.getFieldDescriptions();
            for (int i = 0; i < fds.length; i++)
            {
                fields.add(fds[i]);
            }
        }

        FieldDescriptor[] result = new FieldDescriptor[fields.size()];
        fields.toArray(result);
        return result;
    }
View Full Code Here

  }

  public static void addScriptBlock(FacesContext context, String script) {
    Set<String> set = (Set<String>) context.getAttributes().get(TOBAGO_SCRIPT_BLOCKS);
    if (set == null) {
      set = new ListOrderedSet();
      context.getAttributes().put(TOBAGO_SCRIPT_BLOCKS, set);
    }
    set.add(script);
  }
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.set.ListOrderedSet

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.