|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.prosyst.util.pcommands.PCommandsUtils
public class PCommandsUtils
This class provides utility methods for formatting plain text messages.
| Method Summary | |
|---|---|
static void |
fillColumn(java.io.PrintStream stream,
int full,
java.lang.String message)
This method fills the last column of a text table according to the full line posotion and the message to print. |
static void |
fillColumn(java.io.PrintStream stream,
int full,
java.lang.String message,
int offset)
|
static java.lang.String[] |
makeArray(java.util.Enumeration e,
int size)
Creates an array of String from the elements in the enumeration. |
static void |
printChars(java.io.PrintStream ps,
char ch,
int count,
boolean nl)
|
static void |
printDictionary(java.util.Dictionary d,
java.io.PrintStream stream,
boolean toSort,
int leftColumnNum,
boolean leftLCAlign,
int rightColumnNum,
boolean leftRCAlign)
Prints a dictionary in two columns, so that the keys are on the left column and the values on the right. |
static int |
printSpaces(java.io.PrintStream stream,
int columnSpaces,
int stringSpaces)
The method is used to align a string in a column. |
static void |
quickSort(java.lang.String[] a,
int begin,
int length,
boolean ignoreCase)
Sorts the specified array using the quick sort algorithm. |
static java.lang.String[] |
sort(java.util.Enumeration enumeration,
int size,
boolean ignoreCase,
boolean backSort)
Sorts the specified java.util.Enumeration according to
the specified enumeration size, ignore case flag and back sort flag. |
static void |
sort(java.lang.String[] array,
boolean ignoreCase,
boolean backSort)
Sorts the specified java.lang.String array according to
the ignore case flag and back sort flag. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void printDictionary(java.util.Dictionary d,
java.io.PrintStream stream,
boolean toSort,
int leftColumnNum,
boolean leftLCAlign,
int rightColumnNum,
boolean leftRCAlign)
d - data to be printedstream - to print data totoSort - to sort the keysleftColumnNum - number of symbols in the left columnleftLCAlign - left align of the left columnrightColumnNum - number of symbols in the right columnleftRCAlign - left align of the right column
public static java.lang.String[] makeArray(java.util.Enumeration e,
int size)
e - Enumeration of stringssize - length of the array to return
public static int printSpaces(java.io.PrintStream stream,
int columnSpaces,
int stringSpaces)
stream - to print data tocolumnSpaces - number of symbols of a cloumnstringSpaces - number of symbols of a string
public static void fillColumn(java.io.PrintStream stream,
int full,
java.lang.String message)
stream - the stream where the message will be printed.full - the full line spaces.message - the message which will fill the column of the
text table.
public static void fillColumn(java.io.PrintStream stream,
int full,
java.lang.String message,
int offset)
public static void sort(java.lang.String[] array,
boolean ignoreCase,
boolean backSort)
java.lang.String array according to
the ignore case flag and back sort flag.
array - the array which wil be sorted.ignoreCase - specifies neither the sorting will be done case
sensitive or case insensitive.backSort - specifies either the greates element will be the first
element of the returned array or will be the last.
public static void quickSort(java.lang.String[] a,
int begin,
int length,
boolean ignoreCase)
a - the array for sorting.begin - the begin index.length - the length of the elements which will be sorted.ignoreCase - if this flag is true then the elements comparison
will be case insensitive.
public static java.lang.String[] sort(java.util.Enumeration enumeration,
int size,
boolean ignoreCase,
boolean backSort)
java.util.Enumeration according to
the specified enumeration size, ignore case flag and back sort flag.
enum - java.util.Enumeration wick should be sorted.
Its elements must be instances of java.lang.String and the
enumeration's size shoulb be equals or greater than the specified size.size - the size of the sorted array which will be returned.ignoreCase - specifies neither the sorting will be done case
sensitive or case insensitive.backSort - specifies either the greates element will be the first
element of the returned array or will be the last.
public static void printChars(java.io.PrintStream ps,
char ch,
int count,
boolean nl)
ps - ch - count - nl -
|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||