net.charlesames.utility.html
Class ContinuousGraphBuilder
java.lang.Object
net.charlesames.utility.html.HtmlBuilder
net.charlesames.utility.html.ContinuousGraphBuilder
public class ContinuousGraphBuilder
- extends HtmlBuilder
Generates continuous graphs using HTML formatting tags.
- Author:
- Charles Ames
| Methods inherited from class net.charlesames.utility.html.HtmlBuilder |
addTableCell, append, appendLineBreak, beginBlockQuote, beginBody, beginCenter, beginDiv, beginHead, beginHtml, beginListItem, beginOrderedList, beginParagraph, beginSpan, beginStyle, beginStyleRule, beginTable, beginTableBody, beginTableCell, beginTableHeader, beginTableHeaderCell, beginTableRow, beginTag, beginUnorderedList, buildAttribute, buildColorDeclaration, buildLink, buildStyleDeclaration, endBlockQuote, endBody, endCenter, endDiv, endHead, endHtml, endListItem, endOrderedList, endParagraph, endSpan, endStyle, endStyleRule, endTable, endTableBody, endTableCell, endTableHeader, endTableHeaderCell, endTableRow, endTag, endUnorderedList, newline, popTag, pushTag, reset, save, tab, toString |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ContinuousGraphBuilder
public ContinuousGraphBuilder()
- Constructor for ContinuousGraphBuilder instances.
clear
public void clear()
- Clear all graph data.
getBarColor
public HtmlColor getBarColor()
- Returns:
- The bar color.
setBarColor
public void setBarColor(HtmlColor barColor)
- Parameters:
barColor - The bar color.
getCellWidth
public int getCellWidth()
- Returns:
- The cell width.
setCellWidth
public void setCellWidth(int cellWidth)
- Parameters:
cellWidth - The cell width (should be small).
getZeroValue
public int getZeroValue()
- Returns:
- The value where the horizontal axis is drawn.
setZeroValue
public void setZeroValue(int zeroValue)
- Parameters:
zeroValue - The value where the horizontal axis is drawn.
addColumn
public ContinuousGraphBuilder.Column addColumn()
- Returns:
- The newly created Column object.
addRow
public ContinuousGraphBuilder.Row addRow(int value,
boolean occurence)
- Add a row
- Parameters:
value - occurence -
- Returns:
- The newly created Row instance.
build
public java.lang.String build()
- Returns:
- The HTML text encoding the continuous graph.
locateHistogramRegion
public ContinuousGraphBuilder.HistogramRegion locateHistogramRegion(int value,
int low,
int high)
- Locate the histogram region corresponding to the indicated value.
- Parameters:
value - The indicated value.low - Lower limit for value used by binary search.high - Higher limit for value by binary search.
- Returns:
- The histogram region that contains the indicated value.