Added even more comments

This commit is contained in:
RemoMeijer
2021-01-06 19:29:00 +01:00
parent 5f3fcf2889
commit c3d317baea
6 changed files with 19 additions and 10 deletions

View File

@@ -23,7 +23,7 @@ public enum CouponListManager {
} }
/** /**
* Prepares the list for loading * prepares the list for the adapter
*/ */
public void load(){ public void load(){
CouponLoader couponLoader = new CouponLoader(this.context); CouponLoader couponLoader = new CouponLoader(this.context);

View File

@@ -24,10 +24,9 @@ public enum LocationListManager {
return locationList; return locationList;
} }
public Location getLocation(int place) { /**
return locationList.get(place); * prepares the array list for the adapter
} */
public void load() { public void load() {
LocationLoader locationLoader = new LocationLoader(this.context); LocationLoader locationLoader = new LocationLoader(this.context);
this.locationList = locationLoader.load(); this.locationList = locationLoader.load();

View File

@@ -17,6 +17,10 @@ public class LocationLoader implements Loader<List<Location>> {
this.context = context; this.context = context;
} }
/**
* loads the array list from a JSON file
* @return array list with locations
*/
@Override @Override
public ArrayList<Location> load() { public ArrayList<Location> load() {
FileIO<ArrayList<Location>> fileIO = new FileIO<>(); FileIO<ArrayList<Location>> fileIO = new FileIO<>();

View File

@@ -41,6 +41,10 @@ public class RouteAdapter extends RecyclerView.Adapter<RouteAdapter.RouteViewHol
clickListener.onItemClick(getAdapterPosition()); clickListener.onItemClick(getAdapterPosition());
} }
/**
* sets the text of the route name
* @param text the text that will be set
*/
public void setTextViewText(String text){ public void setTextViewText(String text){
this.routeName = itemView.findViewById(R.id.route_name); this.routeName = itemView.findViewById(R.id.route_name);
this.routeName.setText(text); this.routeName.setText(text);

View File

@@ -18,15 +18,13 @@ public enum RouteListManager{
this.routeList = new ArrayList<>(); this.routeList = new ArrayList<>();
} }
public List<Route> getRouteList() { public List<Route> getRouteList() {
return routeList; return routeList;
} }
public Route getRoute(int place) { /**
return routeList.get(place); * prepares the array list for the adapter
} */
public void load() { public void load() {
RouteLoader routeLoader = new RouteLoader(this.context); RouteLoader routeLoader = new RouteLoader(this.context);
this.routeList = routeLoader.load(); this.routeList = routeLoader.load();

View File

@@ -18,6 +18,10 @@ public class RouteLoader implements Loader<List<Route>> {
this.context = context; this.context = context;
} }
/**
* loads an array list from a JSON
* @return an array list with routes
*/
@Override @Override
public ArrayList<Route> load() { public ArrayList<Route> load() {