All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gov.nasa.pds.citool.registry.model.Slots Maven / Gradle / Ivy

// Copyright 2009, by the California Institute of Technology.
// ALL RIGHTS RESERVED. United States Government sponsorship acknowledged.
// Any commercial use must be negotiated with the Office of Technology Transfer
// at the California Institute of Technology.
//
// This software is subject to U. S. export control laws and regulations
// (22 C.F.R. 120-130 and 15 C.F.R. 730-774). To the extent that the software
// is subject to U.S. export control laws and regulations, the recipient has
// the responsibility to obtain export licenses or other export authority as
// may be required before exporting such information to foreign countries or
// providing access to foreign nationals.
//
// $Id$
package gov.nasa.pds.citool.registry.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class Slots
{
	private Map> map;
	
	public Slots()
	{
		map = new HashMap>();
	}
	
	public void put(String key, String value)
	{
		List list = new ArrayList(1);
		list.add(value);
		map.put(key, list);
	}

	
	public void put(String key, List values)
	{
		map.put(key, values);
	}

	
	public Set>> entrySet()
	{
		return map.entrySet();
	}

	public List get(String key)
	{
		return map.get(key);
	}
	
	public String getFirst(String key)
	{
		List list = map.get(key);
		return (list == null || list.isEmpty()) ? null : list.get(0);
	}
	
	public boolean containsKey(String key)
	{
		return map.containsKey(key);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy