<< Back to Object Oriented Programming Portfolio

Photo Assignment


import java.util.List;

public class Photo
{
    private int widthInPixels;
    private int lengthInPixels;
    private String description;
    private List<Person> peopleInPhoto;
    private int dpi;

    public Photo(int widthInPixels, int lengthInPixels, String description, int dpi)
    {
        this.widthInPixels = widthInPixels;
        this.lengthInPixels = lengthInPixels;
        this.description = description;
        this.dpi = dpi;
    }

    public boolean canBePrinted()
    {
        return (dpi >= 300) ? true : false;
    }

    public boolean isgGroupPhoto()
    {
        return (peopleInPhoto.size() > 1) ? true : false;
    }

    public int getWidthInPixels()
    {
        return this.widthInPixels;
    }

    public int getLengthInPixels()
    {
        return this.lengthInPixels;
    }

    public String getDescription()
    {
        return this.description;
    }

    public int getDpi()
    {
        return this.dpi;
    }

    public List<Person> getPeopleInPhoto()
    {
        return this.peopleInPhoto;
    }
}