当前位置: 首页>>代码示例>>Java>>正文


Java AbstractCollection.iterator方法代码示例

本文整理汇总了Java中java.util.AbstractCollection.iterator方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractCollection.iterator方法的具体用法?Java AbstractCollection.iterator怎么用?Java AbstractCollection.iterator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.AbstractCollection的用法示例。


在下文中一共展示了AbstractCollection.iterator方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: translate

import java.util.AbstractCollection; //导入方法依赖的package包/类
@Override
public Parameter[] translate(AbstractCollection<T> value) throws TranslationException {
	Parameter[] parameters = new Parameter[value.size()];

	int i = 0;
	Iterator<T> it = value.iterator();
	Translator translator = Translator.getInstance();

	while (it.hasNext()) {
		Parameter[] translation = translator.translate2Parameter(it.next());
		if (translation.length == 1) {
			// Translations into single parameters are unwrapped.
			parameters[i] = translation[0];
		} else {
			parameters[i] = new ParameterList(translation);
		}
		i++;
	}
	return new Parameter[] { new ParameterList(parameters) };
}
 
开发者ID:eishub,项目名称:eis,代码行数:21,代码来源:Translator.java

示例2: join

import java.util.AbstractCollection; //导入方法依赖的package包/类
private static String join(AbstractCollection<String> col, String delimiter) {
	if (col.isEmpty()) return "";
	Iterator<String> iter = col.iterator();
	StringBuffer buffer = new StringBuffer(iter.next());
	while(iter.hasNext()) buffer.append(delimiter).append(iter.next());
	return buffer.toString();
}
 
开发者ID:badarshahzad,项目名称:Jfx-Browser,代码行数:8,代码来源:Client.java

示例3: joinStr

import java.util.AbstractCollection; //导入方法依赖的package包/类
public <E> String joinStr(AbstractCollection<E> list, String delim) {
	StringBuffer buf = new StringBuffer();

	Iterator<E> iterator = list.iterator();
	while (iterator.hasNext()) {
		if (buf.length() != 0)
			buf.append(delim);
		buf.append(iterator.next().toString());
	}

	return buf.toString();
}
 
开发者ID:namnoops,项目名称:merjapp,代码行数:13,代码来源:Merge.java

示例4: join

import java.util.AbstractCollection; //导入方法依赖的package包/类
public static String join(AbstractCollection<String> s, String delimiter) {
    if (s.isEmpty()) return "";
    Iterator<String> iter = s.iterator();
    StringBuffer buffer = new StringBuffer(iter.next());
    while (iter.hasNext()) {
        buffer.append(delimiter);
        buffer.append(iter.next());
    }
    return buffer.toString();
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:11,代码来源:StringUtils.java

示例5: join

import java.util.AbstractCollection; //导入方法依赖的package包/类
/**
 * Join multiple strings into a string delimited by the given delimiter.
 * 
 * @param s a collection of strings
 * @param delimiter the delimiter 
 * @return a 'delimiter' separated string
 */
public static String join(AbstractCollection<String> s, String delimiter) {
    if (s.isEmpty()) return "";
    Iterator<String> iter = s.iterator();
    StringBuffer buffer = new StringBuffer(iter.next());
    while (iter.hasNext()) {
        buffer.append(delimiter);
        buffer.append(iter.next());
    }
    return buffer.toString();
}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:18,代码来源:LoadFunc.java

示例6: join

import java.util.AbstractCollection; //导入方法依赖的package包/类
public static String join(AbstractCollection<String> s, String delimiter) {
	if (s == null || s.isEmpty())
		return "";
	Iterator<String> iter = s.iterator();
	StringBuilder builder = new StringBuilder(iter.next());
	while (iter.hasNext()) {
		builder.append(delimiter).append(iter.next());
	}
	return builder.toString();
}
 
开发者ID:2-App-Studio,项目名称:CommonMark-Java,代码行数:11,代码来源:CollectionUtils.java


注:本文中的java.util.AbstractCollection.iterator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。