// 就是对一维数据的查找
public static void main(String[] args) throws Exception {
jp.initData(new DebugInfoJava());
//创建四维数组
NDimensionalArray_ nda = new NDimensionalArray_(2,3,5,7);
/*
//给四维数组赋值
for(int i= 0; i<2;i++) {
for(int j= 0; j < 3; j++) {
for(int k =0; k < 5; k++){
for(int l =0; l < 7; l++)
{
nda.setValue(jp.getRandomInt(1,100) ,i,j,k,l);
}
}
}
}
*/
//给四维数组随机赋值
nda.setRandomInt(1,100);
int i = 0;
for(Object o : nda.m_DataArray) {
++i;
System.out.print(o.toString()+ ",");
if(i % 20 == 0) {
System.out.print("\n");
}
}
System.out.print("\n");
//查找80
for(Object o : nda.m_DataArray) {
if( (int)o == 80)
jp.p("查找到了" +o.toString());
}
}
}
结果: