类 Index<V>
- java.lang.Object
-
- org.meteoinfo.dataframe.Index<V>
-
- 类型参数:
V- Index data type
- 所有已实现的接口:
Iterable<V>
- 直接已知子类:
ColumnIndex,DateTimeIndex,IntIndex,StringIndex
public class Index<V> extends Object implements Iterable<V>
- 作者:
- Yaqiang Wang
-
-
构造器概要
构造器 构造器 说明 Index()
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 voidadd(int i, V v)Add a valuevoidadd(V v)Add a valueIndexappend(Index idx)Append another indexObjectclone()booleancontains(V v)Contains functionstatic Indexfactory(int n)Factory method to create a new index objectstatic Indexfactory(List data)Factory method to create a new index objectstatic Indexfactory(List data, String name)Factory method to create a new index objectstatic Indexfactory(Array data)Factory method to create a new index objectstatic Indexfactory(Array data, String name)Factory method to create a new index objectArrayfillKeyList(Array data, List<Integer> rrdata)Fill key listList<Integer>filterIndices(Array arr)Get indicesVget(int i)Get a valueList<V>getData()Get dataStringgetFormat()Get string formatObject[]getIndices(Object label)Get indicesObject[]getIndices(List<Object> labels)Get indicesObject[]getIndices_bak(List<Object> labels)Get indicesObject[]getIndices_s(Object label)Get indicesStringgetName()Get nameStringgetNameFormat()Get Name formatList<V>getValues()Get dataList<Integer>indexAll(Object k)Get all indices of an index keyintindexOf(Object v)Index ofList<Integer>indexOf(List<V> vs)Index ofInteger[]indices(Object[] names)Get indicesInteger[]indices(List<Object> names)Get indicesIteratoriterator()voidset(int i, V value)Set a valuevoidsetData(List<V> value)Set datavoidsetFormat(String value)Set string formatvoidsetName(String value)Set nameintsize()Get data sizeIndexsubIndex()Sub indexIndexsubIndex(int start, int end, int step)Sub indexIndexsubIndex(List<Integer> idx)Sub indexstatic ListsubList(List list, List<Integer> index)Sub list by indexStringtoString()StringtoString(int idx)Convert i_th index to stringStringtoString(int idx, String format)Convert i_th index to stringStringtoString_Index(int idx)Convert i_th index to stringvoidupdateFormat()Update format-
从接口继承的方法 java.lang.Iterable
forEach, spliterator
-
-
-
-
方法详细资料
-
size
public int size()
Get data size- 返回:
- Index size
-
getFormat
public String getFormat()
Get string format- 返回:
- String format
-
getNameFormat
public String getNameFormat()
Get Name format- 返回:
-
setFormat
public void setFormat(String value)
Set string format- 参数:
value- String format
-
getName
public String getName()
Get name- 返回:
- Name
-
setName
public void setName(String value)
Set name- 参数:
value- Name
-
factory
public static Index factory(List data)
Factory method to create a new index object- 参数:
data- Values- 返回:
- Index object
-
factory
public static Index factory(List data, String name)
Factory method to create a new index object- 参数:
data- Valuesname- Index name- 返回:
- Index object
-
factory
public static Index factory(Array data)
Factory method to create a new index object- 参数:
data- Values- 返回:
- Index object
-
factory
public static Index factory(Array data, String name)
Factory method to create a new index object- 参数:
data- Valuesname- Index name- 返回:
- Index object
-
factory
public static Index factory(int n)
Factory method to create a new index object- 参数:
n- Values number- 返回:
- Index object
-
updateFormat
public void updateFormat()
Update format
-
add
public void add(V v)
Add a value- 参数:
v- Value
-
add
public void add(int i, V v)Add a value- 参数:
i- Indexv- Value
-
get
public V get(int i)
Get a value- 参数:
i- Index- 返回:
- Value
-
set
public void set(int i, V value)Set a value- 参数:
i- Indexvalue- Value
-
indexAll
public List<Integer> indexAll(Object k)
Get all indices of an index key- 参数:
k- The index key- 返回:
- Indices
-
indexOf
public int indexOf(Object v)
Index of- 参数:
v- Value- 返回:
- Index
-
contains
public boolean contains(V v)
Contains function- 参数:
v- Value- 返回:
- Boolean
-
subIndex
public Index subIndex()
Sub index- 返回:
- Index
-
subIndex
public Index subIndex(int start, int end, int step)
Sub index- 参数:
start- Start indexend- End indexstep- Step- 返回:
- Index
-
getIndices
public Object[] getIndices(List<Object> labels)
Get indices- 参数:
labels- Labels- 返回:
- Indices
-
filterIndices
public List<Integer> filterIndices(Array arr)
Get indices- 参数:
arr- Boolean array- 返回:
- Indices
-
getIndices_bak
public Object[] getIndices_bak(List<Object> labels)
Get indices- 参数:
labels- Labels- 返回:
- Indices
-
subList
public static List subList(List list, List<Integer> index)
Sub list by index- 参数:
list- The listindex- The index- 返回:
- Result list
-
fillKeyList
public Array fillKeyList(Array data, List<Integer> rrdata)
Fill key list- 参数:
data- Valid data arrayrrdata- Result data flags- 返回:
- Result data array with same length as key list
-
toString_Index
public String toString_Index(int idx)
Convert i_th index to string- 参数:
idx- Index i- 返回:
- String
-
toString
public String toString(int idx)
Convert i_th index to string- 参数:
idx- Index i- 返回:
- String
-
toString
public String toString(int idx, String format)
Convert i_th index to string- 参数:
idx- Index iformat- Format string- 返回:
- String
-
-