Creating a name class for monsters using arrays and array list. The goal is to randomize the monster names that are being generated. Any help would be greatly appreciated. Thank you.
package character;
import utility.SingleRandom;
import java.util.ArrayList;
import java.util.List;
import java.util.Arrays;
/** Creates a name class for the monsters
/*
*
* Robert Rhinebeck
* CS 140 B 56
* Assignment 3
*/
public class Names
{
// instance variables
private final String nameList;
// class variables
private static final String [] MONSTERNAMES = {"Cletis","Gomez","Pritus","Selus","Teether"};
//private static final int [] NUMBERNAMES = NUMBERNAMES.length;
private static final int [] NUMBERNAMES = 5;
MONSTERNAMES = new int[NUMBERNAMES];
//Static Variables
//This is the single instance accessed by members of
// other classes via the getInstance() factory method
private static Names instance;
static //static initializer: This instantiates it once
{
instance = new Names();
}
ArrayList<String> namesList = new ArrayList<String>();
/** Constructs a names list with monster name array
*/
private Names()
{
List<String> listMonsters = Arrays.asList(MONSTERNAMES);
}
private Names ArrayList(Collection<String>listMonsters)
{
}
// Instance methods
/** Gets max names to start in array
/*
* @return NUMBERNAMES
*/
// accessors
private int getMaxNamesToStart()
{
return NUMBERNAMES;
}
/** Gets the current number of names in the array
* return listMonsters
*/
public int getNumberOfNames()
{
return listMonsters;
}
/** Gets the name of the monster
* @return nameList
*/
public String getName()
{
return MONSTERNAMES[2];
}
/** finds the name of the monster
* @return index[MONSTERNAMES]
*/
public String findName()
{
return index[MONSTERNAMES];
}
/** predicate or boolean for name
* @return name
*/
public boolean hasName()
{
return MONSTERNAMES.equals(nameList);
}
public hasNames()
{
return MONSTERNAMES.equals(listMonsters);
}
}