|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectadams.core.Index
adams.data.spreadsheet.SpreadSheetColumnIndex
public class SpreadSheetColumnIndex
Extended Index class that can use a column name to determine an
index of a column as well.
| 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.Index |
|---|
FIRST, LAST, LAST_1, LAST_2, m_Index, m_IntIndex, m_Max, m_Raw, SECOND, THIRD |
| Constructor Summary | |
|---|---|
SpreadSheetColumnIndex()
Initializes with no index. |
|
SpreadSheetColumnIndex(String index)
Initializes with the given index, but no maximum. |
|
SpreadSheetColumnIndex(String index,
int max)
Initializes with the given index and maximum. |
|
| Method Summary | |
|---|---|
protected String |
clean(String s)
Cleanses the given string. |
String |
getExample()
Returns the example. |
HashMap<String,Integer> |
getIndices()
Returns the indices in use. |
protected List<String> |
getNames()
Returns the column names. |
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 string and checks it against the maximum. |
protected String |
replaceColumnName(String s)
Replaces any column name in the string with the actual 1-based index. |
void |
setSpreadSheet(SpreadSheet value)
Sets the spreadsheet to use for interpreting the column name. |
| Methods inherited from class adams.core.Index |
|---|
compareTo, equals, getIndex, getIntIndex, getMax, hashCode, hasIndex, isPlaceholder, parsePlaceholder, reset, setIndex, setMax, toDisplay, 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 SpreadSheetColumnIndex()
public SpreadSheetColumnIndex(String index)
index - the index to use
public SpreadSheetColumnIndex(String index,
int max)
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 |
|---|
protected void initialize()
initialize in class Indexpublic void setSpreadSheet(SpreadSheet value)
value - the spreadsheet to use, can be nullpublic SpreadSheet getSpreadSheet()
protected List<String> getNames()
public HashMap<String,Integer> getIndices()
protected String replaceColumnName(String s)
s - the string to process
protected boolean isColumnName(String s)
s - the string to process
protected String clean(String s)
clean in class Indexs - the string to clean
protected int parse(String s,
int max)
parse in class Indexs - the string to parsemax - the maximum to allow
public String getExample()
getExample in interface ExampleProvidergetExample in class Index
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||