|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectadams.core.Range
adams.data.spreadsheet.SpreadSheetColumnRange
public class SpreadSheetColumnRange
Extended Range class that also allows column names for specifying
column positions (names are case-insensitive, just like placeholders for
'first', 'second', etc). If column names contain "-" or "," then they
need to be surrounded by double-quotes.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class adams.core.Range |
|---|
Range.SubRange |
| Field Summary | |
|---|---|
protected HashMap<String,Integer> |
m_Indices
the indices of the column names. |
protected List<String> |
m_Names
the column names to replace. |
protected SpreadSheet |
m_Sheet
the underlying spreadsheet. |
| 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, RANGE, SECOND, SEPARATOR, THIRD |
| Constructor Summary | |
|---|---|
SpreadSheetColumnRange()
Initializes with no range. |
|
SpreadSheetColumnRange(String range)
Initializes with the given range, but no maximum. |
|
SpreadSheetColumnRange(String range,
int max)
Initializes with the given range and maximum. |
|
| Method Summary | |
|---|---|
protected boolean |
canReplaceInvalidChars()
Returns whether invalid characters should get removed. |
HashMap<String,Integer> |
getIndices()
Returns the indices in use. |
protected List<String> |
getNames()
Returns the column names. |
protected List<String> |
getPlaceholders()
Returns the placeholders to allow in the ranges. |
SpreadSheet |
getSpreadSheet()
Returns the underlying spreadsheet. |
protected void |
initialize()
For initializing the object. |
protected boolean |
isColumnName(String s)
Checks whether the strings represents a column name. |
protected int |
parse(String s,
int max)
Parses the 1-based index, 'first' and 'last' are accepted as well. |
void |
setSpreadSheet(SpreadSheet value)
Sets the spreadsheet to use for interpreting the column name. |
protected String[] |
splitList(String s)
Attempts to split a list into the parts resembling it. |
protected String[] |
splitRange(String s)
Attempts to split a range into the parts resembling it. |
| Methods inherited from class adams.core.Range |
|---|
clean, compareTo, equals, getActualRange, getExample, getIntIndices, getIntSegments, getMax, getRange, getSubRanges, hashCode, hasRange, isInRange, isInverted, isPlaceholder, isValid, parse, parse, parsePlaceholder, removeInvalidChars, removeInvalidChars, reset, setIndices, setIndices, setInverted, setMax, setRange, toDisplay, toExplicitRange, toRange, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected SpreadSheet m_Sheet
protected List<String> m_Names
protected HashMap<String,Integer> m_Indices
| Constructor Detail |
|---|
public SpreadSheetColumnRange()
public SpreadSheetColumnRange(String range)
range - the range to use
public SpreadSheetColumnRange(String range,
int max)
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 |
|---|
protected void initialize()
initialize in class Rangepublic void setSpreadSheet(SpreadSheet value)
value - the spreadsheet to use, can be nullpublic SpreadSheet getSpreadSheet()
protected List<String> getNames()
public HashMap<String,Integer> getIndices()
protected boolean isColumnName(String s)
s - the string to process
protected List<String> getPlaceholders()
getPlaceholders in class RangegetNames()protected boolean canReplaceInvalidChars()
canReplaceInvalidChars in class Rangeprotected String[] splitRange(String s)
splitRange in class Ranges - the string to split
protected String[] splitList(String s)
splitList in class Ranges - the string to split
protected int parse(String s,
int max)
parse in class Ranges - the string to parsemax - the maximum value to use
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||