public ArrayList<LibraryItem> getCheckedOut( ) { ArrayList<LibraryItem> output = new ArrayList<LibraryItem>(20); for(LibraryItem item : output.values( )) { if(item.isCheckedOut( )) { output.add(item); } } Collections.sort(output); return output; }
HasQuarterState NoQuarterState SoldState SoldOutStateA simpler example is this Two Floor Elevator State Diagram. The states could be represented by the classes FirstFloorState and SecondFloorState. The two actions "Press Button 1" and "Press Button 2" shown on the state diagram are the meaningful actions. Other actions such as "Press Button 1" if the elevator is already at Floor 1 or "Press Button 2" if the elevator is already at Floor 2 are not meaningful and do not result in a state transition. Of course the controller for an elevator is probably not implemented with Java classes.
sqlite> sqlite3 mydatabase.dbmydatabase.db is the database name, which is automatically created if it does not exist.
sqlite> .read students.sql
.bail .databases .exit .headers .help .mode (csv column html insert line list tabs tcl) .open .output .quit .read .save .sep .schema .show .tables .width .timer