APISonar


java.util.ArrayList.toArray

> java > util > ArrayList > toArray
java APIs util APIs ArrayList APIs toArray APIs

Example 1
public <R> R[] toArray( R[] a )
	{
		Object[] array = collection.toArray();
		ArrayList<R> result = new ArrayList<R>();
		for ( int i = 0; i < array.length; i++ )
		{
			result.add( ( R ) underlyingObjectToObject( ( U ) array[ i ] ) );
		}
		return result.toArray( a );
	}
Example 2
ArrayList entries;

    public Object[] toArray () {
        lock.readLock().lock();
        try {
            return entries.toArray();
        } finally {
            lock.readLock().unlock();
        }
    }
Example 3
private ArrayList myArrayList;

	public Object[] toArray() {
		// TODO Auto-generated method stub
		return myArrayList.toArray();
	}
Example 4
int method(ArrayList list) {
        A[] a = (A[])list.toArray(new A[0]);

        for(i = 0; i < a.length; i++) {
            A member = a[i];
        }
    }
Example 5
public Object[] toArray() {
        ArrayList<E> list = new ArrayList<E>();
        Iterator<E> it = iterator();

        while (it.hasNext()) {
            list.add(it.next());
        }

        return list.toArray();
    }
Example 6
private ArrayList<Object> otherMatch;

	public Object[] getOtherBytes()
	{
		return otherMatch.toArray(new Object[0]);
	}
Example 7
final ArrayList			mProviders;

		public JMXConnectorProvider []
	getProviders()
	{
		JMXConnectorProvider []		providers = new JMXConnectorProvider[ mProviders.size() ];
		
		mProviders.toArray( providers );
		return( providers );
	}
Example 8
public Object[] toArray() {
    Iterator<E> iter = iterator();
    ArrayList<Object> al = new ArrayList<Object>();
    while (iter.hasNext()) {
      al.add(iter.next());
    }
    return al.toArray();
  }
Example 9
private final ArrayList<TYPE> list      = new ArrayList<TYPE>();

  public Object[] toArray() {
    convertAll();
    return list.toArray();
  }
Example 10
ArrayList header;

	public String[] getHeaders() {
		String[] r = new String[header.size()];
		if (r.length > 0) {
			r = (String[]) header.toArray(r);
		}
		return r;
	}
Example 11
public Node[] toArray() {
        ArrayList<Node> list = new ArrayList<Node>();
        for (; iterator.hasNext();) {
            list.add(iterator.next());
        }
        return list.toArray(new Node[0]);
    }
Example 12
private final ArrayList<URL> path;

    public URL[] getURLs() {
        synchronized (unopenedUrls) {
            return path.toArray(new URL[0]);
        }
    }
Example 13
public static <A,E extends A> A[] toArray(Enumeration<E> enumeration, A[] array) {
        ArrayList<A> elements = new ArrayList<A>();
        while (enumeration.hasMoreElements()) {
            elements.add(enumeration.nextElement());
        }
        return elements.toArray(array);
    }
Example 14
int[] makeRandomArray() {
        final ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            if (mRandom.nextDouble() < 0.5) {
                list.add(i);
            }
        }
        return Arrays.stream(list.toArray(new Integer[list.size()]))
                .mapToInt(Integer::intValue).toArray();
    }
Example 15
private ArrayList<String> labels;

	public String[] getSliceLabels()
	{
		if (labels.size() == 0)
			return null;
		else
			return labels.toArray(new String[]{});
	}
Example 16
private final ArrayList<String> itemNames = new ArrayList<>();

    public CompositeData createCompositeData() throws OpenDataException {
        return new CompositeDataSupport(compositeType, itemNames
                .toArray(new String[itemNames.size()]), itemValues.toArray());
    }
Example 17
public Object[] toArray() {
        // Use ArrayList to deal with resizing.
        ArrayList<E> al = new ArrayList<E>();
        for (Node<E> p = first(); p != null; p = succ(p)) {
            E item = p.item;
            if (item != null)
                al.add(item);
        }
        return al.toArray();
    }
Example 18
private ArrayList<String> mMccMncs;

    public String toString() {
        return ("AvailableNetworkInfo:"
                + " mSubId: " + mSubId
                + " mPriority: " + mPriority
                + " mMccMncs: " + Arrays.toString(mMccMncs.toArray()));
    }
Example 19
private ArrayList classOrPackageNames;

    public String[] getInstrClassesOrPackages() {
        String[] ret = (String[]) classOrPackageNames.toArray(new String[0]);
        classOrPackageNames = null;

        return ret;
    }
Example 20
private ArrayList<MethodDescriptor> listenerMethodDescriptors;

    public MethodDescriptor[] getListenerMethodDescriptors() {
        return listenerMethodDescriptors == null ? null
                : listenerMethodDescriptors.toArray(new MethodDescriptor[0]);
    }
Example 21
private final ArrayList<String> themes_;

   public String[] getThemeNames()
   {
      return themes_.toArray(new String[themes_.size()]);
   }
Example 22
public String[] getNames()
   {
      ArrayList<String> list = getElementNameList();
      return list.toArray( new String[ list.size() ] );
   }
Example 23
private final ArrayList mChildren = new ArrayList();

    public Configuration[] getChildren()
    {
        return (Configuration[]) mChildren.toArray(
            new Configuration[mChildren.size()]);
    }
Example 24
private ArrayList<T> data_;            // stored sampled items

  public T[] getSamples() {
    if (itemsSeen_ == 0) {
      return null;
    }

    final Class<?> clazz = data_.get(0).getClass();
    return data_.toArray((T[]) Array.newInstance(clazz, 0));
  }
Example 25
protected ArrayList<String> mappings = new ArrayList<String>();

    public String[] findMappings() {

        try {
            mappingsLock.readLock().lock();
            return mappings.toArray(new String[mappings.size()]);
        } finally {
            mappingsLock.readLock().unlock();
        }

    }