< prev index next >

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

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 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. + * @param index which TapStop to return + * @return the TabStop at index {@code index} */ public TabStop getTab(int index) { int numTabs = getTabCount(); if(index < 0 || index >= numTabs)
*** 93,110 **** --- 97,119 ---- } /** * Returns the Tab instance after <code>location</code>. This will * return null if there are no tabs after <code>location</code>. + * @param location location to find a Tab after + * @return the Tab instance after {@code location} */ 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. + * @param tab the TabStop to find * @return the index of the TabStop <code>tab</code>, or -1 if * <code>tab</code> is not contained in the receiver. */ public int getTabIndex(TabStop tab) { for(int counter = getTabCount() - 1; counter >= 0; counter--)
*** 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 >