Java Reference
In-Depth Information
Listing 7-4. The Public Methods of DVDCommand.java
/**
* Default constructor
*/
public DvdCommand() {
this(SocketCommand.UNSPECIFIED);
}
/**
* Constructor that requires the type of command to execute as a parameter.
*
* @param command The id of the command the server is to perform.
*/
public DvdCommand(SocketCommand command) {
this (command, new DVD());
}
/**
* Constructor that requires the type of command and the DVD object.
*
* @param command The id of the command the server is to perform.
* @param aDvd
*/
public DvdCommand(SocketCommand command, DVD dvd) {
setCommandId(command);
this.dvd = dvd;
}
/**
* Gets the query that was used for searching.
*
* @return The string representing the regualr expression to use in find().
*/
public String getRegex() {
return regex;
}
/**
* Sets the regular expression
*
* @param re The regular expression to use in find().
*/
public void setRegex(String re) {
regex = re;
}
Search WWH ::




Custom Search