|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.core.SingleIndex
Class representing a single cardinal number. The number is set by a string representation such as:
first
last
1
3
The number is internally converted from 1-based to 0-based (so methods that set or get numbers not in string format should use 0-based numbers).
Constructor Summary | |
SingleIndex()
Default constructor. |
|
SingleIndex(java.lang.String index)
Constructor to set initial index. |
Method Summary | |
int |
getIndex()
Gets the selected index |
java.lang.String |
getSingleIndex()
Gets the string representing the selected range of values |
static java.lang.String |
indexToString(int index)
Creates a string representation of the given index. |
static void |
main(java.lang.String[] argv)
Main method for testing this class. |
void |
setSingleIndex(java.lang.String index)
Sets the index from a string representation. |
void |
setUpper(int newUpper)
Sets the value of "last". |
java.lang.String |
toString()
Constructs a representation of the current range. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SingleIndex()
public SingleIndex(java.lang.String index)
java.lang.IllegalArgumentException
- if the index is invalidMethod Detail |
public void setUpper(int newUpper)
newUpper
- the value of "last"public java.lang.String getSingleIndex()
public void setSingleIndex(java.lang.String index)
index
- the index set
java.lang.IllegalArgumentException
- if the index was not well formedpublic java.lang.String toString()
toString
in class java.lang.Object
public int getIndex()
java.lang.RuntimeException
- if the upper limit of the index hasn't been definedpublic static java.lang.String indexToString(int index)
public static void main(java.lang.String[] argv)
argv
- one parameter: a test index specification
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2003 David Lindsay, Computer Learning Research Centre, Dept. Computer Science, Royal Holloway, University of London