hw3: add javadoc everywhere

This commit is contained in:
2025-03-26 20:45:09 -07:00
parent c10ba4b2fc
commit f098922149
11 changed files with 346 additions and 10 deletions

View File

@@ -5,6 +5,9 @@ import model.Photo;
import java.util.Comparator;
import java.util.List;
/**
* A sorting strategy that sorts photos by date.
*/
public class SortByDate implements SortingStrategy<Photo> {
@Override
public List<Photo> sort(List<Photo> photos) {

View File

@@ -5,6 +5,9 @@ import model.Photo;
import java.util.Comparator;
import java.util.List;
/**
* A sorting strategy that sorts photos by name.
*/
public class SortByName implements SortingStrategy<Photo> {
@Override
public List<Photo> sort(List<Photo> photos) {

View File

@@ -5,6 +5,9 @@ import model.Photo;
import java.util.Comparator;
import java.util.List;
/**
* A sorting strategy that sorts photos by size.
*/
public class SortBySize implements SortingStrategy<Photo> {
@Override
public List<Photo> sort(List<Photo> photos) {

View File

@@ -2,6 +2,11 @@ package strategy;
import java.util.List;
/**
* Interface for sorting strategies.
*
* @param <T> the type of elements to be sorted
*/
public interface SortingStrategy<T> {
List<T> sort(List<T> photos);
}