當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。