List of usage examples for com.google.common.collect Iterators addAll
public static <T> boolean addAll(Collection<T> addTo, Iterator<? extends T> iterator)
From source file:guru.qas.martini.jmeter.TagResourceBundle.java
@Nonnull @Override// ww w . j av a 2s . c om public Set<String> keySet() { LinkedHashSet<String> set = Sets.newLinkedHashSet(tags); Iterators.addAll(set, delegate.getKeys().asIterator()); return set; }
From source file:com.threerings.parlor.util.RobotPlayer.java
/** * Constructs a robot player.//from w w w. j a va 2s .c om */ public RobotPlayer(Component target, KeyTranslator xlate) { super(Interval.RUN_DIRECT); // save off references _target = target; _xlate = xlate; // build the list of available commands Iterators.addAll(_press, _xlate.enumeratePressCommands()); Iterators.addAll(_release, _xlate.enumerateReleaseCommands()); }
From source file:com.publicuhc.pluginframework.translate.YamlResourceBundle.java
@Override public Enumeration<String> getKeys() { //get all of the keys we know about Set<String> configKeys = configuration.getKeys(true); //if we have a parent file add all of their keys too if (parent != null) { Iterators.addAll(configKeys, Iterators.forEnumeration(parent.getKeys())); }//from ww w. j av a2 s . com //return the list of keys return Collections.enumeration(configKeys); }
From source file:org.richfaces.servlet.ServletConfigDefaultsWrapper.java
@SuppressWarnings({ "unchecked", "rawtypes" }) public Enumeration getInitParameterNames() { Set<String> result = Sets.newHashSet(); Iterators.addAll(result, (Iterator<? extends String>) defaults.keySet()); Iterators.addAll(result, Iterators.forEnumeration(config.getInitParameterNames())); Iterators.addAll(result, Iterators.forEnumeration(config.getServletContext().getInitParameterNames())); return Iterators.asEnumeration(result.iterator()); }
From source file:org.movsim.simulator.roadnetwork.SignalPoint.java
void registerPassingVehicles(double simulationTime, Iterator<Vehicle> vehicles) { this.simulationTime = simulationTime; Iterators.addAll(vehiclesPassed, Iterators.filter(vehicles, predicate)); }
From source file:org.graylog2.filters.FilterServiceImpl.java
@Override public Set<FilterDescription> loadAll() throws NotFoundException { final DBCursor<FilterDescription> filterDescriptions = dbCollection.find(); Set<FilterDescription> filters = Sets.newHashSet(); if (filterDescriptions.hasNext()) { Iterators.addAll(filters, filterDescriptions); }// w ww . j a v a2s. c o m return filters; }
From source file:co.cask.common.lang.CombineClassLoader.java
@Override protected Enumeration<URL> findResources(String name) throws IOException { Set<URL> urls = Sets.newHashSet(); for (ClassLoader classLoader : delegates) { Iterators.addAll(urls, Iterators.forEnumeration(classLoader.getResources(name))); }//w w w . j a va2 s .c om return Iterators.asEnumeration(urls.iterator()); }
From source file:co.cask.cdap.logging.pipeline.LogProcessorPipelineContext.java
public LogProcessorPipelineContext(CConfiguration cConf, String name, final LoggerContext context) { this.name = name; this.loggerContext = context; this.effectiveLoggerCache = CacheBuilder.newBuilder() .maximumSize(cConf.getInt(Constants.Logging.PIPELINE_LOGGER_CACHE_SIZE)) .expireAfterAccess(cConf.getInt(Constants.Logging.PIPELINE_LOGGER_CACHE_EXPIRATION_MS), TimeUnit.MILLISECONDS) .build(new CacheLoader<String, Logger>() { @Override/*from w w w .j av a2 s.co m*/ public Logger load(String loggerName) throws Exception { return Loggers.getEffectiveLogger(context, loggerName); } }); // Grab all the appender instances in the context Set<Appender<ILoggingEvent>> appenders = Sets.newIdentityHashSet(); for (Logger logger : context.getLoggerList()) { Iterators.addAll(appenders, logger.iteratorForAppenders()); } this.appenders = appenders; }
From source file:com.addthis.hydra.data.filter.value.ValueFilterStringSlice.java
@Override public String filter(String value) { if (LessStrings.isEmpty(value)) { return null; }/*from www .j a v a 2 s . c o m*/ if (joinStr == null) { joinStr = sep; } List<String> splitList = new ArrayList<>(); Iterators.addAll(splitList, Splitter.on(sep).split(value).iterator()); if (toIndex == null) { toIndex = splitList.size(); } if (fromIndex == null) { fromIndex = 0; } List<String> subList = splitList.subList(fromIndex, toIndex); return Joiner.on(joinStr).skipNulls().join(subList); }
From source file:io.druid.initialization.ExtensionFirstClassLoader.java
@Override public Enumeration<URL> getResources(final String name) throws IOException { final List<URL> urls = new ArrayList<>(); Iterators.addAll(urls, Iterators.forEnumeration(super.getResources(name))); Iterators.addAll(urls, Iterators.forEnumeration(druidLoader.getResources(name))); return Iterators.asEnumeration(urls.iterator()); }