class Week()
{
Pattern number=Pattern.compile("\\d+\\.?\\d*");
Matcher m;
String sunday;
String monday;
String tuesday;
String wednesday;
String thursday;
String friday;
String saturday;
String []days=new String[7];
}
In one of my methods, I am querying a database to get the hour values for each of the days (i.e. sunday="r8.0d2.0", monday="r6.0d5.0"). I would like to handle it in the following way where days[i] would match the following:
//days[0] correspond to sunday, days[1] to monday, days[2] to tuesday, etc.
for(int i=0;i<7;i++)
{
m=number.matcher(days[i]);
while(m.find())
{
if(i%2==0)
{
double=m.group();
}
else
{
regular=m.group();
}
}
}
I cannot find a way to get days[0] to point at the String object sunday. When sunday changes, days[0] retains the original value of sunday, not the changed one.
I hope I provided enough detail to outline my problem/lack of understanding. Thanks in advance for all that are willing to help!!
JD