Package org.dnsge.powerschoolapi.detail
Class CourseGetter
- java.lang.Object
-
- org.dnsge.powerschoolapi.detail.CourseGetter
-
public class CourseGetter extends java.lang.Object
Class for filtering / searching for courses in an ArrayList by different attributes like name, frequency, or teacher last nameAllows the use of method chaining
- Version:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description CourseGetter(java.util.List<Course> courses)
Creates the CourseGetter with a preliminary list of Courses
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CourseGetter
containsByFrequency(java.lang.String courseFrequency)
Limits remaining courses to contain the frequencyCourseGetter
containsByName(java.lang.String name)
Limits remaining courses to contain the nameCourseGetter
containsByTeacherLastName(java.lang.String teacherLastName)
Limits remaining courses to contain the teacher last nameCourse
first()
Course
get(int index)
Gets the nth resultCourseGetter
limitByFrequency(java.lang.String courseFrequency)
Limits remaining courses to have the exact frequencyCourseGetter
limitByName(java.lang.String name)
Limits remaining courses to have the exact nameCourseGetter
limitByTeacherLastName(java.lang.String teacherLastName)
Limits remaining courses to have the exact teacher last namejava.util.List<Course>
results()
int
size()
Returns the number of results.
-
-
-
Constructor Detail
-
CourseGetter
public CourseGetter(java.util.List<Course> courses)
Creates the CourseGetter with a preliminary list of Courses- Parameters:
courses
- ArrayList to search through
-
-
Method Detail
-
limitByName
public CourseGetter limitByName(java.lang.String name)
Limits remaining courses to have the exact name- Parameters:
name
- Exact name to find- Returns:
- this CourseGetter with updated information
-
containsByName
public CourseGetter containsByName(java.lang.String name)
Limits remaining courses to contain the name- Parameters:
name
- Name to find- Returns:
- this CourseGetter with updated information
-
limitByFrequency
public CourseGetter limitByFrequency(java.lang.String courseFrequency)
Limits remaining courses to have the exact frequency- Parameters:
courseFrequency
- Exact frequency to find- Returns:
- this CourseGetter with updated information
-
containsByFrequency
public CourseGetter containsByFrequency(java.lang.String courseFrequency)
Limits remaining courses to contain the frequency- Parameters:
courseFrequency
- Frequency to find- Returns:
- this CourseGetter with updated information
-
limitByTeacherLastName
public CourseGetter limitByTeacherLastName(java.lang.String teacherLastName)
Limits remaining courses to have the exact teacher last name- Parameters:
teacherLastName
- Exact last name to find- Returns:
- this CourseGetter with updated information
-
containsByTeacherLastName
public CourseGetter containsByTeacherLastName(java.lang.String teacherLastName)
Limits remaining courses to contain the teacher last name- Parameters:
teacherLastName
- Last name to find- Returns:
- this CourseGetter with updated information
-
results
public java.util.List<Course> results()
- Returns:
- New ArrayList Object with the results of the filtering
-
size
public int size()
Returns the number of results.- Returns:
- the number of results
-
get
public Course get(int index)
Gets the nth result- Parameters:
index
- Result number to get- Returns:
- Result at the requested index
-
first
public Course first()
- Returns:
- First Course in the results
-
-