Tabspublic class Tabs extends Object Basic tab-character handling stuff.
N.B. Can only handle equally-spaced tab stops as written. |
Fields Summary |
---|
public static final int | DEFTABSPACEtabs every so often | protected int | tabSpacethe current tab stop setting. | public static final int | MAXLINEThe longest line that we initially set tabs for. | protected boolean[] | tabstopsthe current tab stops |
Constructors Summary |
---|
public Tabs(int n)Construct a Tabs object with a given tab stop settings
if (n <= 0) {
n = 1;
}
tabstops = new boolean[MAXLINE];
tabSpace = n;
settabs();
| public Tabs()Construct a Tabs object with a default tab stop settings
this(DEFTABSPACE);
|
Methods Summary |
---|
public int | getTabSpacing()
return tabSpace;
| public boolean | isTabStop(int col)isTabStop - returns true if given column is a tab stop.
if (col > tabstops.length - 1) {
tabstops = new boolean[tabstops.length * 2];
settabs();
}
return tabstops[col];
| private void | settabs()settabs - set initial tab stops
for (int i = 0; i < tabstops.length; i++) {
tabstops[i] = ((i+1) % tabSpace) == 0;
Debug.println("tabs", "Tabs[" + i + "]=" + tabstops[i]);
}
|
|