The Report Class

Example 5-2 shows part of the com.mycompany.expense.Report class.

Example 5-2. The Report class variables and constructors
package com.mycompany.expense; import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; public class Report implements Serializable { public static final int STATUS_NEW = 0; public static final int STATUS_OPEN = 1; public static final int STATUS_SUBMITTED = 2; public static final int STATUS_ACCEPTED = 3; public static final int STATUS_REJECTED = 4; private int currentEntryId; private int id = -1; private String title; private String owner; private int status = STATUS_NEW; private Map entries; public Report( ) { entries = new HashMap( ); } public Report(Report src) { setId(src.getId( )); setTitle(src.getTitle( )); setOwner(src.getOwner( )); setStatus(src.getStatus( )); setEntries(src.copyEntries( )); setCurrentEntryId(src.getCurrentEntryId( )); } public synchronized int getId( ) { return id; } public synchronized void setId(int id) { this.id = id; } public synchronized String getTitle( ) { return title; } public synchronized void setTitle(String title) { this.title = title; } public synchronized String getOwner( ) { return owner; } public synchronized void setOwner(String owner) { this.owner = owner; } public synchronized int getStatus( ) { return status; } public ...

Get JavaServer Faces now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.