< prev index next >

src/java.desktop/share/classes/javax/swing/text/TabSet.java

Print this page

        

*** 56,65 **** --- 56,66 ---- private int hashCode = Integer.MAX_VALUE; /** * Creates and returns an instance of TabSet. The array of Tabs * passed in must be sorted in ascending order. + * @param tabs the TabStops to initialize the TabSet */ public TabSet(TabStop[] tabs) { // PENDING(sky): If this becomes a problem, make it sort. if(tabs != null) { int tabCount = tabs.length;
*** 71,89 **** --- 72,93 ---- this.tabs = null; } /** * Returns the number of Tab instances the receiver contains. + * @return the number of Tab instances the receiver contains */ public int getTabCount() { return (tabs == null) ? 0 : tabs.length; } /** * Returns the TabStop at index <code>index</code>. This will throw an * IllegalArgumentException if <code>index</code> is outside the range * of tabs. + * @return the TabStop at index {@code index} + * @param index which TapStop to return */ public TabStop getTab(int index) { int numTabs = getTabCount(); if(index < 0 || index >= numTabs)
*** 93,112 **** --- 97,121 ---- } /** * Returns the Tab instance after <code>location</code>. This will * return null if there are no tabs after <code>location</code>. + * @return the Tab instance after {@code location} + * @param location location to find a Tab after */ public TabStop getTabAfter(float location) { int index = getTabIndexAfter(location); return (index == -1) ? null : tabs[index]; } /** + * Returns the index of the TabStop <code>tab</code>, or -1 if + * <code>tab</code> is not contained in the receiver. * @return the index of the TabStop <code>tab</code>, or -1 if * <code>tab</code> is not contained in the receiver. + * @param tab the TabStop to find */ public int getTabIndex(TabStop tab) { for(int counter = getTabCount() - 1; counter >= 0; counter--) // should this use .equals? if(getTab(counter) == tab)
*** 115,124 **** --- 124,135 ---- } /** * Returns the index of the Tab to be used after <code>location</code>. * This will return -1 if there are no tabs after <code>location</code>. + * @param location location to find a Tab after + * @return the index of the Tab to be used after <code>location</code> */ public int getTabIndexAfter(float location) { int current, min, max; min = 0;
< prev index next >