Some more @ReplacedBy annotating.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2763 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
ray.j.greenwell
2010-03-29 21:49:25 +00:00
parent ed9f8502e0
commit ac30065aab
2 changed files with 10 additions and 0 deletions
@@ -28,6 +28,8 @@ import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import com.samskivert.annotation.ReplacedBy;
/**
* A collection of collection-related utility functions.
*/
@@ -49,6 +51,7 @@ public class CollectionUtil
* Adds all items returned by the iterator to the supplied collection and
* returns the supplied collection.
*/
@ReplacedBy("com.google.common.collect.Iterators.addAll()")
public static <T, C extends Collection<T>> C addAll (C col, Iterator<? extends T> iter)
{
while (iter.hasNext()) {
@@ -62,6 +65,7 @@ public class CollectionUtil
* returns the supplied collection. If the supplied array is null, nothing
* is added to the collection.
*/
@ReplacedBy("java.util.Collections.addAll()")
public static <T, E extends T, C extends Collection<T>> C addAll (C col, E[] values)
{
if (values != null) {
@@ -152,6 +156,7 @@ public class CollectionUtil
* Returns an Array, of the type specified by the runtime-type token <code>type</code>,
* containing the elements of the collection.
*/
@ReplacedBy("com.google.common.collect.Iterables.toArray()")
public static <T> T[] toArray (Collection<? extends T> col, Class<T> type)
{
@SuppressWarnings("unchecked")
@@ -169,6 +174,7 @@ public class CollectionUtil
* order returned by the collection's iterator). The size of the array will
* be equal to the size of the collection.
*/
@ReplacedBy("com.google.common.primitives.Ints.toArray()")
public static int[] toIntArray (Collection<Integer> col)
{
Iterator<Integer> iter = col.iterator();
@@ -22,6 +22,8 @@ package com.samskivert.util;
import java.util.*;
import com.samskivert.annotation.ReplacedBy;
/**
* Provides functionality for the samskivert collections that the <code>java.util</code> class of
* the same name provides for the standard Java collections. Collections-related functionality that
@@ -36,6 +38,7 @@ public class Collections
*
* @param metaIterable an iterable of Iterators.
*/
@ReplacedBy("com.google.common.collect.Iterators.concat() or com.google.common.collect.Iterables.concat()")
public static <T> Iterator<T> getMetaIterator (Iterable<Iterator<T>> metaIterable)
{
return new MetaIterator<T>(metaIterable);
@@ -136,6 +139,7 @@ public class Collections
/**
* Get an iterator that returns the same elements as the supplied iterator but blocks removal.
*/
@ReplacedBy("com.google.common.collect.Iterators.unmodifiableIterator")
public static <T> Iterator<T> getUnmodifiableIterator (final Iterator<T> itr)
{
return new Iterator<T>() {