I am writing a program that, in its setup, wants to read words from a text file and save them into an object of class word, along with the coordinates of the word-objects center, and a randomly generated greyscale value fill. I want processing to arrange the word squares in a grid pattern, which doesn't seem like it would be too tricky (I'm new to both processing and programming) but I'm having some issues:
//take out all punctuation using regex, make new word object containing a word,
//and add it to the array
//Pattern parserPat = Pattern.compile("([a-zA-Z]*?)");
public class Word {
/*this class is the word object which contains variables for the value of the
word, the coordinates of its center, and its fill color.*/
String value;
int xCenter;
int yCenter;
int greyRGB;
public void setWord(String input){
input=value;
}
public String getWord(){
return word;
}
public void setCenterX (int x){
xCenter= x;
}
public int getCenterX (){
return centerX;
}
public void setCenterY (int y){
yCenter= y;
}
public int getCenterY (){
return centerX;
}
public void setColor (int rgb) {
greyRGB= rgb;
}
public int getColor(){
return greyRGB;
}
public String toString(){
return value;
}
}
and the issue is that not only is it not seeing internal methods like setCenterX(), it's not even printing my println, even when outside of the while-loop. Also, was fretting about my regex, and not compliling "ArrayList<Word>" words.
I'm thinking about ditching my internal class entirely and using hashmaps, but it seems like I'm missing some trivial beans.