Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.textflex.txtfl
Class Txtflo  view Txtflo download Txtflo.java

java.lang.Object
  extended bycom.textflex.txtfl.Txtflo

public class Txtflo
extends java.lang.Object

The tXtFL simulator is the talk of the crowd. Or, if not, tXtFL is at least doing a lot of the talking. As a text-based football simulator, the tXtFL code needs to implement a lot of talking to communicate with the user. Some talk is generic, robotic, such as the statistical displays, but most of the rest needs to be fluid, dynamic, flowing. Txtflo tried to let the talk flow like a river, melliflous as a sportscaster. Of course, the talk can get technical, too, but never boring. The game itself hopefully ensures that.

Txtflo mostly consists of static methods to access from anywhere within tXtFL classes. Just supply the necessary team names, scores, or the like, and Txtflo should do the rest. Then the coder can rest.


Field Summary
private static java.text.NumberFormat numFormat
           
private static java.text.MessageFormat ordinalDowns
           
private static java.text.MessageFormat ordinalQuarters
           
 
Constructor Summary
Txtflo()
          Contructs an empty object.
 
Method Summary
static java.lang.String answerChoices(java.lang.String[] answers, boolean ignoreDefault)
           
static java.lang.String convertDown(int down)
          Converts a down number into a ordinal format.
static java.lang.String convertQuarter(int quarter)
          Converts a quarter number into a ordinal format.
static java.lang.String convertScores(int score1, int score2, java.lang.String team1, java.lang.String team2)
           
static java.lang.String convertTime(int seconds)
          Converts the time from seconds to min:sec format.
static java.lang.String relativeYardline(int ydline, java.lang.String offense, java.lang.String defense)
          Converts the given yardline relative to the offense's goal into a string showing the yardline relative to which half of the field the offense is on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ordinalDowns

private static java.text.MessageFormat ordinalDowns

ordinalQuarters

private static java.text.MessageFormat ordinalQuarters

numFormat

private static java.text.NumberFormat numFormat
Constructor Detail

Txtflo

public Txtflo()
Contructs an empty object.

Method Detail

convertDown

public static java.lang.String convertDown(int down)
Converts a down number into a ordinal format.


convertQuarter

public static java.lang.String convertQuarter(int quarter)
Converts a quarter number into a ordinal format.


convertTime

public static java.lang.String convertTime(int seconds)
Converts the time from seconds to min:sec format.


convertScores

public static java.lang.String convertScores(int score1,
                                             int score2,
                                             java.lang.String team1,
                                             java.lang.String team2)

relativeYardline

public static java.lang.String relativeYardline(int ydline,
                                                java.lang.String offense,
                                                java.lang.String defense)
Converts the given yardline relative to the offense's goal into a string showing the yardline relative to which half of the field the offense is on. For example, the 56 yardline is translated into the "Defense's 44". The 50 yardline is simply called "The 50".


answerChoices

public static java.lang.String answerChoices(java.lang.String[] answers,
                                             boolean ignoreDefault)