Example usage for java.util AbstractCollection iterator

List of usage examples for java.util AbstractCollection iterator

Introduction

In this page you can find the example usage for java.util AbstractCollection iterator.

Prototype

public abstract Iterator<E> iterator();

Source Link

Document

Returns an iterator over the elements contained in this collection.

Usage

From source file:com.aregner.pandora.XmlRpc.java

public static String value(AbstractCollection<?> list) {
    StringBuilder result = new StringBuilder("<value><array><data>");
    Iterator<?> listIter = list.iterator();
    while (listIter.hasNext()) {
        result.append(valueGuess(listIter.next()));
    }//www  . j av  a2 s  . c  o m
    return result.append("</data></array></value>").toString();
}

From source file:bz.tsung.jsonapi4j.serialization.SingletonSerializer.java

@Override
public void serialize(AbstractCollection data, JsonGenerator jsonGenerator,
        SerializerProvider serializerProvider) throws IOException {
    jsonGenerator.writeObject(data.iterator().next());
}