Package adams.data.spreadsheet
Class SpreadSheetRowIndex
- java.lang.Object
-
- adams.core.Index
-
- adams.core.AbstractDataBackedIndex<SpreadSheet>
-
- adams.data.spreadsheet.SpreadSheetRowIndex
-
- All Implemented Interfaces:
CloneHandler<Index>,CustomDisplayStringProvider,ExampleProvider,HelpProvider,Serializable,Comparable<Index>
public class SpreadSheetRowIndex extends AbstractDataBackedIndex<SpreadSheet>
ExtendedIndexclass for SpreadSheet objects.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SpreadSheetRowIndex()Initializes with no index.SpreadSheetRowIndex(String index)Initializes with the given index, but no maximum.SpreadSheetRowIndex(String index, int max)Initializes with the given index and maximum.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SpreadSheetRowIndexgetClone()Returns a clone of the object.protected StringgetName(SpreadSheet data, int colIndex)Unused.protected List<String>getNames()Returns the names.protected intgetNumNames(SpreadSheet data)Returns the number of rows the dataset has.SpreadSheetgetSpreadSheet()Returns the underlying spreadsheet.voidsetSpreadSheet(SpreadSheet value)Sets the spreadsheet to use for interpreting the row name.-
Methods inherited from class adams.core.AbstractDataBackedIndex
clean, getData, getIndices, getIntIndex, initialize, isName, parse, replaceName, setData
-
Methods inherited from class adams.core.Index
compareTo, equals, getExample, getHelpDescription, getHelpIcon, getHelpTitle, getHelpURL, getIndex, getIntIndex, getMax, hashCode, hasIndex, isEmpty, isPlaceholder, parsePlaceholder, reset, setIndex, setMax, toDisplay, toString
-
-
-
-
Constructor Detail
-
SpreadSheetRowIndex
public SpreadSheetRowIndex()
Initializes with no index.
-
SpreadSheetRowIndex
public SpreadSheetRowIndex(String index)
Initializes with the given index, but no maximum.- Parameters:
index- the index to use
-
SpreadSheetRowIndex
public SpreadSheetRowIndex(String index, int max)
Initializes with the given index and maximum.- Parameters:
index- the index to usemax- the maximum of the 1-based index (e.g., use "10" to allow "1-10" or -1 for uninitialized)
-
-
Method Detail
-
setSpreadSheet
public void setSpreadSheet(SpreadSheet value)
Sets the spreadsheet to use for interpreting the row name.- Parameters:
value- the spreadsheet to use, can be null
-
getSpreadSheet
public SpreadSheet getSpreadSheet()
Returns the underlying spreadsheet.- Returns:
- the underlying spreadsheet, null if none set
- See Also:
AbstractDataBackedIndex.getData()
-
getClone
public SpreadSheetRowIndex getClone()
Returns a clone of the object.- Specified by:
getClonein interfaceCloneHandler<Index>- Overrides:
getClonein classAbstractDataBackedIndex<SpreadSheet>- Returns:
- the clone
-
getNumNames
protected int getNumNames(SpreadSheet data)
Returns the number of rows the dataset has.- Specified by:
getNumNamesin classAbstractDataBackedIndex<SpreadSheet>- Parameters:
data- the dataset to retrieve the number of rows
-
getName
protected String getName(SpreadSheet data, int colIndex)
Unused.- Specified by:
getNamein classAbstractDataBackedIndex<SpreadSheet>- Parameters:
data- the dataset to usecolIndex- the row index- Returns:
- the row name
-
getNames
protected List<String> getNames()
Returns the names.- Overrides:
getNamesin classAbstractDataBackedIndex<SpreadSheet>- Returns:
- the names
-
-