Path: blob/master/SLICK_HOME/src/org/newdawn/slick/command/BasicCommand.java
1456 views
package org.newdawn.slick.command;12/**3* A simple named command4*5* @author kevin6*/7public class BasicCommand implements Command {8/** The name of the command */9private String name;1011/**12* Create a new basic command13*14* @param name The name to give this command15*/16public BasicCommand(String name) {17this.name = name;18}1920/**21* Get the name given for this basic command22*23* @return The name given for this basic command24*/25public String getName() {26return name;27}2829/**30* @see java.lang.Object#hashCode()31*/32public int hashCode() {33return name.hashCode();34}3536/**37* @see java.lang.Object#equals(java.lang.Object)38*/39public boolean equals(Object other) {40if (other instanceof BasicCommand) {41return ((BasicCommand) other).name.equals(name);42}4344return false;45}4647/**48* @see java.lang.Object#toString()49*/50public String toString() {51return "[Command="+name+"]";52}53}545556