|
LPEX 4.4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ibm.lpex.samples.WordsCommand
public class WordsCommand
Sample command words - count the words in the current view. Displays the number of visible words and non-space characters in the text. If a selection is in effect, only the selected text is considered.
A simple scanning for letters and digits is used, rather than a BreakIterator, which is sufficient for most types of programming source documents. A word can be optionally defined to consist of any consecutive non-whitespace characters.
Here is the WordsCommand source code.
To run this sample:
set commandClass.words com.ibm.lpex.samples.WordsCommand
words [any]
All the samples| Constructor Summary | |
|---|---|
WordsCommand()
|
|
| Method Summary | |
|---|---|
boolean |
doCommand(LpexView lpexView,
String parameters)
Runs this command. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WordsCommand()
| Method Detail |
|---|
public boolean doCommand(LpexView lpexView,
String parameters)
doCommand in interface LpexCommandlpexView - the document view in which the command was issuedparameters - optional parameter: "?" for help, or "any" to define
a word as a string of any non-whitespace characters
|
LPEX 4.4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||