|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.udo.cs.yale.example.ExampleFormatter
public class ExampleFormatter
Formats an example as specified by the format string. The dollar sign '$' is an escape character. Squared brackets '[' and ']' have a special meaning. The following escape sequences are interpreted:
| Nested Class Summary | |
|---|---|
static interface |
ExampleFormatter.FormatCommand
Represents one piece of formatting. |
static class |
ExampleFormatter.SimpleCommand
Implements some simple format commands like 'a' for all attributes or 'l' for the label. |
static class |
ExampleFormatter.TextCommand
Returns simply the given text. |
static class |
ExampleFormatter.ValueCommand
Returns the value of an argument which must be an attribute's name. |
| Field Summary | |
|---|---|
private ExampleFormatter.FormatCommand[] |
formatCommands
The commands used subsequently to format the example. |
| Constructor Summary | |
|---|---|
ExampleFormatter(ExampleFormatter.FormatCommand[] formatCommands)
Constructs a new ExampleFormatter that executes the given array of formatting commands. |
|
| Method Summary | |
|---|---|
static ExampleFormatter |
compile(java.lang.String formatString,
ExampleSet exampleSet)
Factory method that compiles a format string and creates an instance of ExampleFormatter. |
private static void |
compile(java.lang.String formatString,
ExampleSet exampleSet,
java.util.List<ExampleFormatter.FormatCommand> commandList)
Adds all commands to the commandList. |
java.lang.String |
format(Example example)
Formats a single example. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private ExampleFormatter.FormatCommand[] formatCommands
| Constructor Detail |
|---|
public ExampleFormatter(ExampleFormatter.FormatCommand[] formatCommands)
compile(String, ExampleSet) a format string.
| Method Detail |
|---|
public static ExampleFormatter compile(java.lang.String formatString,
ExampleSet exampleSet)
private static void compile(java.lang.String formatString,
ExampleSet exampleSet,
java.util.List<ExampleFormatter.FormatCommand> commandList)
commandList.
public java.lang.String format(Example example)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||