com.rabidgremlin.mutters.core.Slots Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mutters-core Show documentation
Show all versions of mutters-core Show documentation
A framework for building bots.
package com.rabidgremlin.mutters.core;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
/**
* Helper class for managing a map of slots.
*
* @author rabidgremlin
*
*/
public class Slots
{
/** The map of slots. */
private HashMap slots = new HashMap();
/**
* Adds a slot to the map.
*
* @param slot The slot to add.
*/
public void add(Slot slot)
{
slots.put(slot.getName().toLowerCase(), slot);
}
/**
* Gets the specified slot from the map.
*
* @param name The name of the slot.
* @return The name of the slot or null if the slot does not exist in the map.
*/
public Slot getSlot(String name)
{
return slots.get(name.toLowerCase());
}
/**
* Returns the slots in the map.
*
* @return The slots in the map.
*/
public Collection getSlots()
{
return Collections.unmodifiableCollection(slots.values());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy