AbstractCollection toArray - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for AbstractCollection toArray method.

This code example shows how to use the following methods:toArray, size, addAll
    final AuthenticationData data = localStorage.get(url);
    if (data == null)
    { 
      return backend.getDefinedOptions(url);
    } 
    final LinkedHashSet<String> keys = new LinkedHashSet<String>();
    keys.addAll(Arrays.asList(backend.getDefinedOptions(url)));
    keys.addAll(Arrays.asList(data.getDefinedOptions()));
    return keys.toArray(new String[keys.size()]);
  } 
 
  public String[] getKnownURLs()
  { 
    final LinkedHashSet<String> keys = new LinkedHashSet<String>();
    keys.addAll(Arrays.asList(backend.getKnownURLs()));
    keys.addAll(Arrays.asList(localStorage.keySet().toArray(new String[localStorage.size()])));
    return keys.toArray(new String[keys.size()]);
  } 
 
 
7
CodeRank
This code example shows how to use the following methods:addAll, toArray, size
    if (additionalFields == null)
    { 
      return null; 
    } 
 
    final LinkedHashSet<String> fields = new LinkedHashSet<String>(Arrays.asList(super.getReferencedFields(query, parameter)));
    fields.addAll(Arrays.asList(additionalFields));
    return fields.toArray(new String[fields.size()]);
  } 
 
  public ArrayList<Object> getQueryHash(final String queryName, final DataRow parameter)
  { 
    final ArrayList<Object> queryHash = super.getQueryHash(queryName, parameter);
    queryHash.add(scriptingSupport.getScriptingLanguage(queryName));
    queryHash.add(scriptingSupport.getScript(queryName));
    return queryHash;
  } 
 
  public SQLReportDataFactory clone() 
  { 
7
CodeRank
This code example shows how to use the following methods:addAll, toArray, size
    if (additionalFields == null)
    { 
      return null; 
    } 
     
    final LinkedHashSet<String> fields = new LinkedHashSet<String>(Arrays.asList(super.getReferencedFields(query, parameter)));
    fields.addAll(Arrays.asList(additionalFields));
    return fields.toArray(new String[fields.size()]);
  } 
 
  public ArrayList<Object> getQueryHash(final String queryName, final DataRow parameters)
  { 
    final ArrayList<Object> queryHash = super.getQueryHash(queryName, parameters);
    queryHash.add(scriptingSupport.getScriptingLanguage(queryName));
    queryHash.add(scriptingSupport.getScript(queryName));
    return queryHash;
  } 
 
  public PmdDataFactory clone() 
  { 
7
CodeRank
This code example shows how to use the following methods:toArray, addAll, size
    return list.toArray(new String[list.size()]);
  } 
 
  private String[] computeRows(final CrosstabGroup crosstabGroup)
  { 
    final LinkedHashSet<String> list = new LinkedHashSet<String>();
    list.addAll(crosstabGroup.getPaddingFields());
    collectRelationalFields(crosstabGroup.getParentSection(), list);
    collectCrosstabFields(crosstabGroup, list);
    return list.toArray(new String[list.size()]);
  } 
 
  private void collectRelationalFields (Section section, final HashSet<String> list)
  { 
    while (section != null)
    { 
      if (section instanceof AbstractReportDefinition)
      { 
        return; 
      } 
7
CodeRank
This code example shows how to use the following methods:addAll, toArray, size
    if (additionalFields == null)
    { 
      return null; 
    } 
 
    final LinkedHashSet<String> fields = new LinkedHashSet<String>(Arrays.asList(super.getReferencedFields(query, parameter)));
    fields.addAll(Arrays.asList(additionalFields));
    return fields.toArray(new String[fields.size()]);
  } 
 
  public ArrayList<Object> getQueryHash(final String queryName, final DataRow parameters) throws ReportDataFactoryException
  { 
    final ArrayList<Object> queryHash = super.getQueryHash(queryName, parameters);
    queryHash.add(scriptingSupport.getScriptingLanguage(queryName));
    queryHash.add(scriptingSupport.getScript(queryName));
    return queryHash;
  } 
 
  public void close() 
  { 
7
CodeRank
This code example shows how to use the following methods:toArray, size
    this.registeredFiles.add(name);
  } 
 
  public synchronized String[] getRegisteredFiles ()
  { 
    return this.registeredFiles.toArray(new String[registeredFiles.size()]);
  } 
} 
6
CodeRank
This code example shows how to use the following methods:toArray, size
 
	/** 
	 * Returns the paths that have been collected. 
	 */ 
	public String[] getPaths() {
		return (String[]) this.paths.toArray(new String[this.paths.size()]);
	} 
} 
6
CodeRank
This code example shows how to use the following methods:toArray, size
                    _engine.queryFields(roles, _roleBase, _roleId, _rolePerms, perms);
                } 
 
                // @TODO throws the ObjectNotFoundException, 
                // RoleNotFoundException properly 
                TreeSet<String> result = new TreeSet<String>();
                _engine.queryFields(perms, _permBase, _permId, _permObjects, result);
                return (String[]) result.toArray(new String[result.size()]);
            } catch (NamingException ne) {
                if (LOG.isInfoEnabled()) 
                    LOG.info(ne.getMessage(), ne);
                throw new RBACException(ne);
            } 
        } 
 
        /** 
         * @see org.intalio.tempo.security.rbac.RBACQuery#userOperationsOnObject(java.lang.String, 
         *      java.lang.String) 
         */ 
        public String[] userOperationsOnObject(String user, String object)
6
CodeRank
This code example shows how to use the following methods:toArray, size
    } 
  } 
 
  public String[] getManagedHosts()
  { 
    return hosts.toArray(new String[hosts.size()]);
  } 
 
  private LinkedHashSet<String> getFilesAsList()
      throws BackingStoreException 
  { 
    final LinkedHashSet<String> retval = new LinkedHashSet<String>();
    final String[] strings = properties.keys();
    final int maxFiles = Math.min(10, strings.length);
    for (int i = 0; i < maxFiles; i++)
    { 
      final String key = strings[i];
      final String file = properties.get(key, null);
 
      if (file == null)
6
CodeRank
This code example shows how to use the following methods:toArray
        injectionPoints = new InjectionPoint[this.method.getTypeParameters().length];
        for (int i = 0; i < injectionPoints.length; ++i) {
            injectionPoints[i] = new ImmutableInjectionPoint(method.getParameters().get(i), manager, bean, false, false);
        } 
        Type mainType = method.getDeclaringType().getBaseType();
        HashSet<Annotation> mainClassQualifiers = new HashSet<Annotation>(declaringBeanQualifiers);
        Set<Bean<?>> beans = manager.getBeans(mainType, mainClassQualifiers.toArray(new Annotation[0]));
        if (beans.isEmpty()) {
            throw new UnsatisfiedResolutionException("Could not find declaring bean for @Unwrap method " + method.getDeclaringType().getJavaClass() + "." + this.method.getName());
        } else if (beans.size() > 1) {
            throw new AmbiguousResolutionException("Could not find declaring bean for @Unwrap method " + method.getDeclaringType().getJavaClass() + "." + this.method.getName());
        } 
        mainClassBean = beans.iterator().next();
        this.injectionPoint = injectionPoint;
    } 
 
    public Object invoke(Object proxy, Method thisMethod, Method m, Object[] args) throws Throwable {
        CreationalContext<?> ctx = manager.createCreationalContext(bean);
        Object[] params = new Object[method.getParameterTypes().length];
        for (int i = 0; i < this.method.getParameterTypes().length; ++i) {
6
CodeRank

Related AbstractCollection toArray Questions & Answers:

toArray Method Overview
Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array. This implementation returns an array containing all the elements returned by this collection's iterator in the same order, stored in consecutive elements of the array, starting with index 0.
See Code Examples for other Java 8 AbstractCollection Methods: