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 worry about tabs for. | protected boolean[] | tabstopsthe current tab stops |
Constructors Summary |
---|
public Tabs(int n)Construct a Tabs object with a given tab stop settings
tabstops = new boolean[MAXLINE];
tabSpace = n;
settabs();
| public Tabs()Construct a Tabs object with a default tab stop settings
tabstops = new boolean[MAXLINE];
settabs();
|
Methods Summary |
---|
public void | settabs()settabs - set initial tab stops
int i;
for (i = 0; i < tabstops.length; i++) {
tabstops[i] = 0 == (i % tabSpace);
Debug.println("settabs", "Tabs[" + i + "]=" + tabstops[i]);
}
| boolean | tabpos(int col)tabpos - returns true if given column is a tab stop.
If current input line is too long, we just put tabs whereever,
no exception is thrown.
if (col > tabstops.length-1)
return true;
else
return tabstops[col];
|
|