Package adams.data.spreadsheet
Class SpreadSheetRowRange
- java.lang.Object
-
- adams.core.Range
-
- adams.core.AbstractDataBackedRange<SpreadSheet>
-
- adams.data.spreadsheet.SpreadSheetRowRange
-
- All Implemented Interfaces:
CloneHandler<Range>
,CustomDisplayStringProvider
,ExampleProvider
,HelpProvider
,Serializable
,Comparable<Range>
public class SpreadSheetRowRange extends AbstractDataBackedRange<SpreadSheet>
ExtendedRange
class for SpreadSheet objects.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class adams.core.AbstractDataBackedRange
AbstractDataBackedRange.InvertedStringLengthComparator
-
Nested classes/interfaces inherited from class adams.core.Range
Range.SubRange
-
-
Field Summary
-
Fields inherited from class adams.core.AbstractDataBackedRange
m_Data, m_Indices, m_Names
-
Fields inherited from class adams.core.Range
ALL, FIRST, INV_END, INV_START, LAST, LAST_1, LAST_2, m_ActualRange, m_Inverted, m_Max, m_Range, m_Raw, m_SubRanges, NUMERIC_START, RANGE, SECOND, SEPARATOR, THIRD
-
-
Constructor Summary
Constructors Constructor Description SpreadSheetRowRange()
Initializes with no range.SpreadSheetRowRange(String range)
Initializes with the given range, but no maximum.SpreadSheetRowRange(String range, int max)
Initializes with the given range and maximum.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SpreadSheetRowRange
getClone()
Returns a clone of the object.protected String
getName(SpreadSheet data, int colIndex)
Unused.protected List<String>
getNames()
Returns the names.protected int
getNumNames(SpreadSheet data)
Returns the number of rows the dataset has.SpreadSheet
getSpreadSheet()
Returns the underlying spreadsheet.void
setSpreadSheet(SpreadSheet value)
Sets the spreadsheet to use for interpreting the row name.-
Methods inherited from class adams.core.AbstractDataBackedRange
canReplaceInvalidChars, escapeName, getData, getIndices, getIndices, getIntIndices, getIntSegments, initialize, initLookUp, isInRange, isName, parse, reset, setData, splitList, splitRange, unescapeName
-
Methods inherited from class adams.core.Range
clean, compareTo, equals, getActualRange, getExample, getHelpDescription, getHelpIcon, getHelpTitle, getHelpURL, getIntIndices, getIntSegments, getMax, getRange, getSubRanges, hashCode, hasRange, isAllRange, isEmpty, isInRange, isInverted, isPlaceholder, isValid, parse, parse, parsePlaceholder, setIndices, setIndices, setInverted, setMax, setRange, toDisplay, toExplicitRange, toRange, toString
-
-
-
-
Constructor Detail
-
SpreadSheetRowRange
public SpreadSheetRowRange()
Initializes with no range.
-
SpreadSheetRowRange
public SpreadSheetRowRange(String range)
Initializes with the given range, but no maximum.- Parameters:
range
- the range to use
-
SpreadSheetRowRange
public SpreadSheetRowRange(String range, int max)
Initializes with the given range and maximum.- Parameters:
range
- the range 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:
AbstractDataBackedRange.getData()
-
getClone
public SpreadSheetRowRange getClone()
Returns a clone of the object.- Specified by:
getClone
in interfaceCloneHandler<Range>
- Overrides:
getClone
in classAbstractDataBackedRange<SpreadSheet>
- Returns:
- the clone
-
getNumNames
protected int getNumNames(SpreadSheet data)
Returns the number of rows the dataset has.- Specified by:
getNumNames
in classAbstractDataBackedRange<SpreadSheet>
- Parameters:
data
- the dataset to retrieve the number of rows
-
getName
protected String getName(SpreadSheet data, int colIndex)
Unused.- Specified by:
getName
in classAbstractDataBackedRange<SpreadSheet>
- Parameters:
data
- the dataset to usecolIndex
- the row index- Returns:
- the row name
-
getNames
protected List<String> getNames()
Returns the names.- Overrides:
getNames
in classAbstractDataBackedRange<SpreadSheet>
- Returns:
- the names
-
-