Example usage for com.google.common.collect FluentIterable toArray

List of usage examples for com.google.common.collect FluentIterable toArray

Introduction

In this page you can find the example usage for com.google.common.collect FluentIterable toArray.

Prototype

@GwtIncompatible("Array.newArray(Class, int)")
@CheckReturnValue
public final E[] toArray(Class<E> type) 

Source Link

Document

Returns an array containing all of the elements from this fluent iterable in iteration order.

Usage

From source file:org.eclipse.tracecompass.tmf.ui.views.histogram.HistogramDataModel.java

/**
 * Gets the traces names of this model.// ww w .jav  a 2  s.  c o m
 *
 * @return an array of trace names
 */
public String[] getTraceNames() {
    FluentIterable<ITmfTrace> traces = FluentIterable.from(TmfTraceManager.getTraceSet(fTrace));
    FluentIterable<String> traceNames = traces.transform(new Function<ITmfTrace, String>() {
        @Override
        public String apply(ITmfTrace input) {
            return input.getName();
        }
    });
    return traceNames.toArray(String.class);
}