Package java.util

Examples of java.util.HashSet.toArray()


        do {
            ifaces.addAll(Arrays.asList(clazz.getInterfaces()));
            clazz = clazz.getSuperclass();
        } while (clazz != null);
        return Proxy.newProxyInstance(InvocationCounter.class.getClassLoader(),
                (Class[])ifaces.toArray(new Class[ifaces.size()]), new InvocationHandlerImpl(target));
    }

    /**
     * Get the number of invocations counted by this instance.
     *
 
View Full Code Here


 
  public String[] listAll() throws IOException {
    Set files = new HashSet();
    files.addAll(Arrays.asList(primaryDir.listAll()));
    files.addAll(Arrays.asList(secondaryDir.listAll()));
    return (String[]) files.toArray(new String[files.size()]);
  }
 
  public String[] list() throws IOException {
    return listAll();
  }
View Full Code Here

            // existing mixin's
            HashSet set = new HashSet(((NodeState) state).getMixinTypeNames());
            // primary type
            set.add(primaryTypeName);
            // build effective node type representing primary type including existing mixin's
            entExisting = ntReg.getEffectiveNodeType((QName[]) set.toArray(new QName[set.size()]));
            if (entExisting.includesNodeType(mixinName)) {
                throw new RepositoryException(mixinName + ": already contained in mixin types");
            }
            // add new mixin
            set.add(mixinName);
View Full Code Here

                throw new RepositoryException(mixinName + ": already contained in mixin types");
            }
            // add new mixin
            set.add(mixinName);
            // try to build new effective node type (will throw in case of conflicts)
            ntReg.getEffectiveNodeType((QName[]) set.toArray(new QName[set.size()]));
        } catch (NodeTypeConflictException ntce) {
            throw new ConstraintViolationException(ntce.getMessage());
        }

        // do the actual modifications implied by the new mixin;
View Full Code Here

            // remaining mixin's
            HashSet set = new HashSet(remainingMixins);
            // primary type
            set.add(primaryTypeName);
            // build effective node type representing primary type including remaining mixin's
            entRemaining = ntReg.getEffectiveNodeType((QName[]) set.toArray(new QName[set.size()]));
        } catch (NodeTypeConflictException ntce) {
            throw new ConstraintViolationException(ntce.getMessage());
        }

        /**
 
View Full Code Here

            // existing mixin's
            HashSet set = new HashSet(((NodeState) state).getMixinTypeNames());
            // primary type
            set.add(primaryTypeName);
            // build effective node type representing primary type including existing mixin's
            entExisting = ntReg.getEffectiveNodeType((QName[]) set.toArray(new QName[set.size()]));
            if (entExisting.includesNodeType(ntName)) {
                return false;
            }
            // add new mixin
            set.add(ntName);
View Full Code Here

                return false;
            }
            // add new mixin
            set.add(ntName);
            // try to build new effective node type (will throw in case of conflicts)
            ntReg.getEffectiveNodeType((QName[]) set.toArray(new QName[set.size()]));
        } catch (NodeTypeConflictException ntce) {
            return false;
        }

        return true;
View Full Code Here

      if ((n.startsWith("get") && pt.length==0) || (n.startsWith("set") && pt.length==1 && rt==Void.TYPE))
  pm.add(n.substring(3,4).toLowerCase()+n.substring(4));
    }

    //    pm.remove("class"); // do we want this available ?
    gbif.addInterface(c, (String[])pm.toArray(new String[pm.size()]));
    //gbif.addInterface(c);
    GBeanData gbd=new GBeanData(createObjectName(name), gbif.getBeanInfo());
    // ensure the injection of the InvocationHandler into the newly instantiated Proxy
    gbd.setAttribute("invocationHandler"  , new InvocationHandler(bean));
View Full Code Here

        internalSetProperty(QName.JCR_MERGEFAILED, (InternalValue[]) null);

        // 3. N's jcr:isCheckedOut property is set to false.
        internalSetProperty(QName.JCR_ISCHECKEDOUT, InternalValue.create(false));

        return (Version[]) restored.toArray(new Version[restored.size()]);
    }

    /**
     * Restores the properties and child nodes from the frozen state.
     *
 
View Full Code Here

    for (int i = 0; i < services.length; i++) {
      ids[i]=services[i].getId();
      types.add(services[i].getType());
    }
   
    dictionary.put(UPnPService.TYPE, types.toArray(new String[]{}));
    dictionary.put(UPnPService.ID, ids);
  }
 
 
  /* (non-Javadoc)
 
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.