1 23 24 package com.sun.enterprise.cli.framework; 25 26 import java.util.HashMap ; 27 import java.util.Iterator ; 28 import java.io.Serializable ; 29 30 34 public class ValidCommandsList implements Serializable 35 { 36 37 private HashMap validCommands = null; 38 39 40 public ValidCommandsList() 41 { 42 validCommands = new HashMap (); 43 } 44 45 46 51 public ValidCommand getValidCommand(String commandName) 52 { 53 return (ValidCommand) validCommands.get(commandName); 54 } 55 56 57 60 public Iterator getCommands() 61 { 62 return validCommands.values().iterator(); 63 } 64 65 66 69 public int size() 70 { 71 return validCommands.size(); 72 } 73 74 75 78 public void addCommand(ValidCommand command) 79 { 80 validCommands.put(command.getName(), command); 81 } 82 83 84 86 public void removeAllCommands() 87 { 88 validCommands.clear(); 89 } 90 } 91 | Popular Tags |