cds.sql
Class DisplayResultFormat

java.lang.Object
  extended bycds.sql.DisplayResultFormat

public class DisplayResultFormat
extends java.lang.Object

Display Strategy. The switch class used to invoke the defined output. A set of classes implementing a strategy pattern for several ways of displaying rows from the database.

Version:
1.0 May 2003 1.1 July 2003 (SJ) : ajout des methodes display(...,nbToDisplay...) et display(...msg...) 1.2 Janvier 2004 (BB) : ajout des methods pour manipuler les ResultSetBean
Author:
Marc Wenger, Sylvaine Jaehn, Benoit Baranne (Stagiaire UTBM)

Field Summary
private  DisplayResult disp
           
private  boolean out
           
private  java.io.PrintStream prt
           
 
Constructor Summary
DisplayResultFormat()
           
 
Method Summary
 void display(java.sql.ResultSet rs)
          Display the result set according to the current output mode
 void display(ResultSetBean rsb)
          MOD-BB 08-01-04 Ajout de cette methode.
 void display(ResultSetBean rsb, int nbToDisplay)
          MOD-BB 08-01-04 Ajout de cette methode.
 void display(java.sql.ResultSet rs, int nbToDisplay)
          Display the nbToDisplay next lines of the result set according to the current output mode
 void display(java.lang.String msg)
          Display the message according to the current output mode
 void setOutput(boolean out)
          Defines if the output should occur or not
 void setOutput(java.io.PrintStream prt)
          Defines the output stream
 void setReport()
          Sets report as the current output mode
 void setTable()
          Sets table as the current output mode
 void setTSV()
          Sets Tab Separated Value output as the current mode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

disp

private DisplayResult disp

prt

private java.io.PrintStream prt

out

private boolean out
Constructor Detail

DisplayResultFormat

public DisplayResultFormat()
Method Detail

setTSV

public void setTSV()
Sets Tab Separated Value output as the current mode


setTable

public void setTable()
Sets table as the current output mode


setReport

public void setReport()
Sets report as the current output mode


display

public void display(java.sql.ResultSet rs)
Display the result set according to the current output mode

Parameters:
rs - Result set to display

display

public void display(ResultSetBean rsb)
MOD-BB 08-01-04 Ajout de cette methode. Display the ResultSetBean according to the current output mode

Parameters:
rsb - ResultSetBean a afficher.

display

public void display(java.lang.String msg)
Display the message according to the current output mode

Parameters:
msg - message as a String to display

display

public void display(java.sql.ResultSet rs,
                    int nbToDisplay)
Display the nbToDisplay next lines of the result set according to the current output mode

Parameters:
rs - Result set to display
nbToDisplay - number of lines to display

display

public void display(ResultSetBean rsb,
                    int nbToDisplay)
MOD-BB 08-01-04 Ajout de cette methode. Display the nbToDisplay next lines of the result set according to the current output mode

Parameters:
rsb - ResultSetBean to display
nbToDisplay - number of lines to display

setOutput

public void setOutput(java.io.PrintStream prt)
Defines the output stream

Parameters:
prt - output print stream

setOutput

public void setOutput(boolean out)
Defines if the output should occur or not

Parameters:
out - true if the output should be done, false otherwise