O'Reilly logo

JavaServer Faces by Hans Bergsten

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required