BetterAlias/com/gmail/Ne0nx3r0/AliasManager/Alias.java

20 lines
581 B
Java
Raw Normal View History

2012-04-22 02:54:44 +02:00
package com.gmail.Ne0nx3r0.AliasManager;
import java.util.HashMap;
import java.util.Map;
class Alias{
//mapping number of parameters to string(s) to be executed
2012-04-30 18:25:55 +02:00
private Map<String,String[]> params = new HashMap<String,String[]>();
2012-04-22 02:54:44 +02:00
2012-04-30 18:25:55 +02:00
public Alias(Map<String,String[]> p){
2012-04-22 02:54:44 +02:00
this.params = p;
}
public String[] getCommands(int p){
2012-04-30 18:25:55 +02:00
if(this.params.containsKey(Integer.toString(p))){
return this.params.get(Integer.toString(p));
}
return this.params.get("*");//or null if it doesn't exist
2012-04-22 02:54:44 +02:00
}
}