程序包 weka.core
类 SingleIndex
java.lang.Object
weka.core.SingleIndex
- 所有已实现的接口:
Serializable
,RevisionHandler
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).
- 版本:
- $Revision: 1.8 $
- 作者:
- Eibe Frank (eibe@cs.waikato.ac.nz)
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明int
getIndex()
Gets the selected indexReturns the revision string.Gets the string representing the selected range of valuesstatic String
indexToString
(int index) Creates a string representation of the given index.static void
Main method for testing this class.void
setSingleIndex
(String index) Sets the index from a string representation.void
setUpper
(int newUpper) Sets the value of "last".toString()
Constructs a representation of the current range.
-
构造器详细资料
-
SingleIndex
public SingleIndex()Default constructor. -
SingleIndex
Constructor to set initial index.- 参数:
index
- the initial index- 抛出:
IllegalArgumentException
- if the index is invalid
-
-
方法详细资料
-
setUpper
public void setUpper(int newUpper) Sets the value of "last".- 参数:
newUpper
- the value of "last"
-
getSingleIndex
Gets the string representing the selected range of values- 返回:
- the range selection string
-
setSingleIndex
Sets the index from a string representation. Note that setUpper() must be called for the value to be actually set- 参数:
index
- the index set- 抛出:
IllegalArgumentException
- if the index was not well formed
-
toString
Constructs a representation of the current range. Being a string representation, the numbers are based from 1. -
getIndex
public int getIndex()Gets the selected index- 返回:
- the selected index
- 抛出:
RuntimeException
- if the upper limit of the index hasn't been defined
-
indexToString
Creates a string representation of the given index.- 参数:
index
- the index to turn into a string. Since the index will typically come from a program, indices are assumed from 0, and thus will have 1 added in the String representation.- 返回:
- the string representation
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 返回:
- the revision
-
main
Main method for testing this class.- 参数:
argv
- one parameter: a test index specification
-