com.samskivert.util.IntMaps Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of samskivert Show documentation
Show all versions of samskivert Show documentation
A collection of Java utilities.
//
// samskivert library - useful routines for java programs
// Copyright (C) 2001-2012 Michael Bayne, et al.
// http://github.com/samskivert/samskivert/blob/master/COPYING
package com.samskivert.util;
import com.samskivert.annotation.ReplacedBy;
/**
* Provides static methods for creating mutable {@code IntMap} instances easily.
* You can replace code like:
*
* {@code IntMap map = new HashIntMap();}
*
* with just:
*
*
{@code IntMap map = IntMaps.newHashIntMap();}
*/
@ReplacedBy(value="com.google.common.collect.Maps",
reason="Boxing shouldn't be a major concern. It's probably better to stick to " +
"standard classes rather than worry about a tiny memory or performance gain.")
public class IntMaps
{
/**
* Creates a {@code HashIntMap} instance.
*
* @return a newly-created, initially-empty {@code HashIntMap}
*/
@ReplacedBy(value="com.google.common.collect.Maps#newHashMap()")
public static HashIntMap newHashIntMap()
{
return new HashIntMap();
}
}