temp.txt deleted online with Bitbucket

This commit is contained in:
Alan Elliott
2018-03-23 16:29:56 -07:00
committed by CekisSWG
parent f52aebcfb1
commit a72a84cef8
82556 changed files with 4633262 additions and 4288 deletions
@@ -0,0 +1,33 @@
/*
Title: collections.java
Description: adds functionality similar to the java.util.Collections class
*/
package script;
import java.util.HashMap;
import java.util.Map;
public class collections
{
/**
* Creates a new Map from two parallel arrays. The arrays must be non-null and of the same length.
* The data in the keys array must be non-null, but the values data may be null.
*
* @return the mapping of the keys to the values, or null on error
*/
public static Map newMap(Object[] keys, Object[] values)
{
if ( keys == null || values == null || keys.length != values.length )
return null;
Map map = new HashMap(keys.length);
for ( int i = 0; i < keys.length; ++i )
{
if ( keys[i] == null )
return null;
map.put(keys[i], values[i]);
}
return map;
}
}