|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.foxsmart.csu.config.Command
public class Command
The Command class represents a single command that can be sent to the router. The command may contain 1 line or multiple lines. If multiple lines are sent, the first line is considered the main command while the remaining lines (if any) are considered follow-up lines that are necessary to complete the command.
Empty or null lines are filtered out. A Command may be deferred when the deferred flag is set to true. Deferred commands will be issued after all other non-deferred commands have been sent.
| Constructor Summary | |
|---|---|
Command(java.lang.String command)
Creates a command from a string. |
|
| Method Summary | |
|---|---|
void |
add(int index,
java.lang.String line)
Adds a line at a specified position |
void |
add(java.lang.String line)
Adds a line to the command. |
void |
addAll(java.util.ArrayList lines)
Appends all the passed in lines to the end of the list. |
void |
addAll(int index,
java.util.ArrayList lines)
Inserts all the lines at the specified offset. |
void |
clear()
Clears out all the lines. |
boolean |
equals(java.lang.Object command)
Determines if two commands are equal (i.e. |
java.lang.String |
get(int index)
Gets the line at the specified position. |
boolean |
getDeferredFlag()
Gets the deferred flag. |
java.lang.String |
getFullCommand()
Returns the full command. |
java.util.List |
getFullCommandAsList()
Returns the full command and trims each line to remove leading and trailing spaces. |
java.lang.String |
getFullTrimmedCommand()
Returns the full command and trims each line to remove leading and trailing spaces. |
java.util.List |
getFullTrimmedCommandAsList()
Returns the full command and trims each line to remove leading and trailing spaces. |
java.lang.String |
getMainCommand()
Gets the main command for this multi-line command. |
java.lang.String |
getMainTrimmedCommand()
Gets the main command for this multi-line command and trims the command to ensure no leading and trailing spaces are present. |
boolean |
isEmpty()
Returns if the command is empty or not. |
java.util.Iterator |
iterator()
Returns an iterator to iterate through each of the lines. |
java.lang.String |
remove(int index)
Removes the line at the specified position. |
java.lang.String |
set(int index,
java.lang.String line)
Sets the line at the specified offset. |
void |
setDeferredFlag(boolean deferredFlag)
Sets the deferred flag. |
int |
size()
Returns the number of lines. |
java.lang.String |
toString()
Returns a string representation of this command. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Command(java.lang.String command)
command - The command stored as a string.| Method Detail |
|---|
public java.lang.String getMainCommand()
public java.lang.String getMainTrimmedCommand()
public java.lang.String getFullCommand()
public java.lang.String getFullTrimmedCommand()
public java.util.List getFullCommandAsList()
public java.util.List getFullTrimmedCommandAsList()
public java.lang.String toString()
toString in class java.lang.Objectpublic void add(java.lang.String line)
line - The line to add.
public void add(int index,
java.lang.String line)
index - The index where the line will be addedline - The line to add.public void addAll(java.util.ArrayList lines)
lines - The list of lines to add
public void addAll(int index,
java.util.ArrayList lines)
index - The index where the lines will be addedlines - The list of lines to addpublic void clear()
public java.lang.String get(int index)
index - The index for the line to get.
java.lang.IndexOutOfBoundsException - if the offset doesn't exist.public java.lang.String remove(int index)
index - The index for the line to remove.
java.lang.IndexOutOfBoundsException - if the offset doesn't exist.
public java.lang.String set(int index,
java.lang.String line)
index - The index where the line will be addedline - The line to set.
java.lang.IndexOutOfBoundsException - if the offset doesn't exist.public java.util.Iterator iterator()
public int size()
public boolean isEmpty()
public boolean equals(java.lang.Object command)
equals in class java.lang.Objectcommand - The command to compare to.
public boolean getDeferredFlag()
public void setDeferredFlag(boolean deferredFlag)
deferredFlag - True to defer the command or false to process it normally.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||