I'm re-evaluating whether or not to use XML to store data. XML introduces an element of complexity to the coding. I want to keep it simple.
I'm considering the possibility of storing data using a pre-defined class, called Classroom:
public class Classroom
{
private String classroomname;
private String mon[] = new String[24];
private String tues[] = new String[24];
private String wed[] = new String[24];
private String thurs[] = new String[24];
private String fri[] = new String[24];
private String sat[] = new String[24];
public void setMonSlot(String name, int time)
{
mon[time] = name;
}
public void setTuesSlot(String name, int time)
{
tues[time] = name;
}
public void setWedSlot(String name, int time)
{
wed[time] = name;
}
public void setThursSlot(String name, int time)
{
thurs[time] = name;
}
public void setFriSlot(String name, int time)
{
fri[time] = name;
}
public void setSatSlot(String name, int time)
{
sat[time] = name;
}
//////////////////////////////////////////
public String getMonSlot(int time)
{
return mon[time];
}
public String getTuesSlot(int time)
{
return tues[time];
}
public String getWedSlot(int time)
{
return wed[time];
}
public String getThursSlot(int time)
{
return thurs[time];
}
public String getFriSlot(int time)
{
return fri[time];
}
public String getSatSlot(int time)
{
return sat[time];
}
}
It will be stored in files as Classroom objects.