gnu.trove.TDecorators Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of trove4j Show documentation
Show all versions of trove4j Show documentation
The Trove library provides high speed regular and primitive
collections for Java.
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2008, Robert D. Eden All Rights Reserved.
// Copyright (c) 2009, Jeff Randall All Rights Reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
///////////////////////////////////////////////////////////////////////////////
package gnu.trove;
import java.util.*;
import gnu.trove.list.*;
import gnu.trove.map.*;
import gnu.trove.set.*;
import gnu.trove.decorator.*;
/**
* This is a static utility class that provides functions for simplifying creation of
* decorators.
*
* @author Robert D. Eden
* @author Jeff Randall
* @since Trove 2.1
*/
public class TDecorators {
// Hide the constructor
private TDecorators() {}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TDoubleDoubleObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TDoubleDoubleMap map ) {
return new TDoubleDoubleMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TDoubleFloatObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TDoubleFloatMap map ) {
return new TDoubleFloatMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TDoubleIntObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TDoubleIntMap map ) {
return new TDoubleIntMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TDoubleLongObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TDoubleLongMap map ) {
return new TDoubleLongMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TDoubleByteObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TDoubleByteMap map ) {
return new TDoubleByteMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TDoubleShortObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TDoubleShortMap map ) {
return new TDoubleShortMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TDoubleCharObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TDoubleCharMap map ) {
return new TDoubleCharMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TFloatDoubleObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TFloatDoubleMap map ) {
return new TFloatDoubleMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TFloatFloatObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TFloatFloatMap map ) {
return new TFloatFloatMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TFloatIntObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TFloatIntMap map ) {
return new TFloatIntMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TFloatLongObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TFloatLongMap map ) {
return new TFloatLongMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TFloatByteObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TFloatByteMap map ) {
return new TFloatByteMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TFloatShortObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TFloatShortMap map ) {
return new TFloatShortMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TFloatCharObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TFloatCharMap map ) {
return new TFloatCharMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TIntDoubleObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TIntDoubleMap map ) {
return new TIntDoubleMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TIntFloatObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TIntFloatMap map ) {
return new TIntFloatMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TIntIntObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TIntIntMap map ) {
return new TIntIntMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TIntLongObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TIntLongMap map ) {
return new TIntLongMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TIntByteObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TIntByteMap map ) {
return new TIntByteMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TIntShortObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TIntShortMap map ) {
return new TIntShortMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TIntCharObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TIntCharMap map ) {
return new TIntCharMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TLongDoubleObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TLongDoubleMap map ) {
return new TLongDoubleMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TLongFloatObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TLongFloatMap map ) {
return new TLongFloatMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TLongIntObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TLongIntMap map ) {
return new TLongIntMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TLongLongObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TLongLongMap map ) {
return new TLongLongMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TLongByteObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TLongByteMap map ) {
return new TLongByteMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TLongShortObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TLongShortMap map ) {
return new TLongShortMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TLongCharObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TLongCharMap map ) {
return new TLongCharMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TByteDoubleObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TByteDoubleMap map ) {
return new TByteDoubleMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TByteFloatObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TByteFloatMap map ) {
return new TByteFloatMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TByteIntObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TByteIntMap map ) {
return new TByteIntMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TByteLongObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TByteLongMap map ) {
return new TByteLongMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TByteByteObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TByteByteMap map ) {
return new TByteByteMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TByteShortObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TByteShortMap map ) {
return new TByteShortMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TByteCharObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TByteCharMap map ) {
return new TByteCharMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TShortDoubleObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TShortDoubleMap map ) {
return new TShortDoubleMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TShortFloatObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TShortFloatMap map ) {
return new TShortFloatMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TShortIntObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TShortIntMap map ) {
return new TShortIntMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TShortLongObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TShortLongMap map ) {
return new TShortLongMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TShortByteObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TShortByteMap map ) {
return new TShortByteMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TShortShortObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TShortShortMap map ) {
return new TShortShortMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TShortCharObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TShortCharMap map ) {
return new TShortCharMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TCharDoubleObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TCharDoubleMap map ) {
return new TCharDoubleMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TCharFloatObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TCharFloatMap map ) {
return new TCharFloatMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TCharIntObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TCharIntMap map ) {
return new TCharIntMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TCharLongObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TCharLongMap map ) {
return new TCharLongMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TCharByteObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TCharByteMap map ) {
return new TCharByteMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TCharShortObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TCharShortMap map ) {
return new TCharShortMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TCharCharObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TCharCharMap map ) {
return new TCharCharMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TObjectDoubleMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TObjectDoubleMap map ) {
return new TObjectDoubleMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TObjectFloatMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TObjectFloatMap map ) {
return new TObjectFloatMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TObjectIntMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TObjectIntMap map ) {
return new TObjectIntMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TObjectLongMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TObjectLongMap map ) {
return new TObjectLongMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TObjectByteMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TObjectByteMap map ) {
return new TObjectByteMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TObjectShortMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TObjectShortMap map ) {
return new TObjectShortMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TObjectCharMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TObjectCharMap map ) {
return new TObjectCharMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TDoubleObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TDoubleObjectMap map ) {
return new TDoubleObjectMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TFloatObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TFloatObjectMap map ) {
return new TFloatObjectMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TIntObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TIntObjectMap map ) {
return new TIntObjectMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TLongObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TLongObjectMap map ) {
return new TLongObjectMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TByteObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TByteObjectMap map ) {
return new TByteObjectMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TShortObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TShortObjectMap map ) {
return new TShortObjectMapDecorator( map );
}
/**
* Wrap the given map in a decorator that uses the standard {@link java.util.Map Map}
* interface.
*
* @param map the TCharObjectMap to be wrapped
* @return the wrapped map.
*/
public static Map wrap( TCharObjectMap map ) {
return new TCharObjectMapDecorator( map );
}
/**
* Wrap the given set in a decorator that uses the standard {@link java.util.Set Set}
* interface.
*
* @param set the TDoubleSet to be wrapped
* @return the wrapped set.
*/
public static Set wrap( TDoubleSet set ) {
return new TDoubleSetDecorator( set );
}
/**
* Wrap the given set in a decorator that uses the standard {@link java.util.Set Set}
* interface.
*
* @param set the TFloatSet to be wrapped
* @return the wrapped set.
*/
public static Set wrap( TFloatSet set ) {
return new TFloatSetDecorator( set );
}
/**
* Wrap the given set in a decorator that uses the standard {@link java.util.Set Set}
* interface.
*
* @param set the TIntSet to be wrapped
* @return the wrapped set.
*/
public static Set wrap( TIntSet set ) {
return new TIntSetDecorator( set );
}
/**
* Wrap the given set in a decorator that uses the standard {@link java.util.Set Set}
* interface.
*
* @param set the TLongSet to be wrapped
* @return the wrapped set.
*/
public static Set wrap( TLongSet set ) {
return new TLongSetDecorator( set );
}
/**
* Wrap the given set in a decorator that uses the standard {@link java.util.Set Set}
* interface.
*
* @param set the TByteSet to be wrapped
* @return the wrapped set.
*/
public static Set wrap( TByteSet set ) {
return new TByteSetDecorator( set );
}
/**
* Wrap the given set in a decorator that uses the standard {@link java.util.Set Set}
* interface.
*
* @param set the TShortSet to be wrapped
* @return the wrapped set.
*/
public static Set wrap( TShortSet set ) {
return new TShortSetDecorator( set );
}
/**
* Wrap the given set in a decorator that uses the standard {@link java.util.Set Set}
* interface.
*
* @param set the TCharSet to be wrapped
* @return the wrapped set.
*/
public static Set wrap( TCharSet set ) {
return new TCharSetDecorator( set );
}
/**
* Wrap the given list in a decorator that uses the standard {@link java.util.List List}
* interface.
*
* @param list the TDoubleList to be wrapped
* @return the wrapped list.
*/
public static List wrap( TDoubleList list ) {
return new TDoubleListDecorator( list );
}
/**
* Wrap the given list in a decorator that uses the standard {@link java.util.List List}
* interface.
*
* @param list the TFloatList to be wrapped
* @return the wrapped list.
*/
public static List wrap( TFloatList list ) {
return new TFloatListDecorator( list );
}
/**
* Wrap the given list in a decorator that uses the standard {@link java.util.List List}
* interface.
*
* @param list the TIntList to be wrapped
* @return the wrapped list.
*/
public static List wrap( TIntList list ) {
return new TIntListDecorator( list );
}
/**
* Wrap the given list in a decorator that uses the standard {@link java.util.List List}
* interface.
*
* @param list the TLongList to be wrapped
* @return the wrapped list.
*/
public static List wrap( TLongList list ) {
return new TLongListDecorator( list );
}
/**
* Wrap the given list in a decorator that uses the standard {@link java.util.List List}
* interface.
*
* @param list the TByteList to be wrapped
* @return the wrapped list.
*/
public static List wrap( TByteList list ) {
return new TByteListDecorator( list );
}
/**
* Wrap the given list in a decorator that uses the standard {@link java.util.List List}
* interface.
*
* @param list the TShortList to be wrapped
* @return the wrapped list.
*/
public static List wrap( TShortList list ) {
return new TShortListDecorator( list );
}
/**
* Wrap the given list in a decorator that uses the standard {@link java.util.List List}
* interface.
*
* @param list the TCharList to be wrapped
* @return the wrapped list.
*/
public static List wrap( TCharList list ) {
return new TCharListDecorator( list );
}
}