Package java.util

Examples of java.util.LinkedHashSet.toArray()


      while (candidates != null && candidates.hasMoreElements()) {
        resources.add((URL) candidates.nextElement());
      }
    }

    return (URL[]) resources.toArray(new URL[resources.size()]);
  }

  // TODO: can this return null or throw an exception
  public String getPathWithinContext() {
    return pathWithoutPrefix;
View Full Code Here


      }
    }
    if (logger.isTraceEnabled()) {
      logger.trace("Resolved location pattern [" + locationPattern + "] to resources " + result);
    }
    return (Resource[]) result.toArray(new Resource[result.size()]);
  }

  /**
   * {@inheritDoc}
   *
 
View Full Code Here

        }

        clz = clz.getSuperclass();
      } while (clz != null && clz != Object.class);

      classes = (Class[]) composingClasses.toArray(new Class[composingClasses.size()]);
    }
    return (classes == null ? new Class[0] : classes);
  }

  /**
 
View Full Code Here

      Class clzz = (Class) iter.next();
      if (!loader.canSee(clzz.getName())) {
        iter.remove();
      }
    }
    return (Class[]) classSet.toArray(new Class[classSet.size()]);
  }

  /**
   * Get all interfaces implemented by the given class. This method returns
   * both parent and children interfaces (i.e. Map and SortedMap).
View Full Code Here

      catch (ClassNotFoundException ex) {
        // ignore
      }
    }

    return (Class[]) classes.toArray(new Class[classes.size()]);
  }

  /**
   * Exclude classes from the given array, which match the given modifier.
   *
 
View Full Code Here

    for (int i = 0; i < classes.length; i++) {
      if ((modifier & classes[i].getModifiers()) == 0)
        clazzes.add(classes[i]);
    }
    return (Class[]) clazzes.toArray(new Class[clazzes.size()]);
  }

}
View Full Code Here

    Set classes = new LinkedHashSet(intfs.length + autoDetectedClasses.length);

    CollectionUtils.mergeArrayIntoCollection(intfs, classes);
    CollectionUtils.mergeArrayIntoCollection(autoDetectedClasses, classes);

    Class[] mergedClasses = (Class[]) classes.toArray(new Class[classes.size()]);

    ServiceRegistration reg = registerService(mergedClasses, serviceProperties);

    serviceRegistration = notifyListeners(target, (Map) serviceProperties, reg);
  }
View Full Code Here

          cumulatedPackages.addAll(determineImportsForClass(className, (Resource) entry.getValue()));
        }
      }
    }

    return (String[]) cumulatedPackages.toArray(new String[cumulatedPackages.size()]);
  }

  /**
   * Determine imports for a class given as a String resource. This method
   * doesn't do any search for the enclosing/inner classes as it considers
View Full Code Here

                Object[] objects = selectionConvertor.getElements(structuredModel, regions[i].getOffset(), regions[i].getLength());
                for (int j = 0; j < objects.length; j++) {
                  blockObjects.add(objects[j]);
                }
              }
              selection = new StructuredTextSelection(getDocument(), (ITextSelection) selection, blockObjects.toArray());
            }
            else {
              int start = ((ITextSelection) selection).getOffset();
              int end = start + ((ITextSelection) selection).getLength();
              selection = new StructuredTextSelection(getDocument(), (ITextSelection) selection, selectionConvertor.getElements(structuredModel, start, end));
View Full Code Here

                Object[] objects = selectionConvertor.getElements(structuredModel, regions[i].getOffset(), regions[i].getLength());
                for (int j = 0; j < objects.length; j++) {
                  blockObjects.add(objects[j]);
                }
              }
              selection = new StructuredTextSelection(getDocument(), (ITextSelection) selection, blockObjects.toArray());
            }
            else {
              int start = ((ITextSelection) selection).getOffset();
              int end = start + ((ITextSelection) selection).getLength();
              selection = new StructuredTextSelection(getDocument(), (ITextSelection) selection, selectionConvertor.getElements(structuredModel, start, end));
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.