⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 table.java

📁 geotools的源码
💻 JAVA
字号:
package uk.ac.leeds.ccg.geotools;

import java.lang.*;
import java.util.*;
import java.io.*;
public class Table extends java.lang.Object
{
    int colCount = 0;
    protected Hashtable table;
    public Table()
    {
        table = new Hashtable();
        //Not sure what to do here yet!
    }
    
    public void addCol(String name,Hashtable col)
    {
        table.put(name,col);
        colCount++;
    }
    
    public double getDouble(String col,int id){
        Hashtable h;
        h=(Hashtable)table.get(col);
        Double value = (Double)h.get(new Integer(id));
        if (value != null)
            return value.doubleValue();
        else
            return -9999;
    }
    
    public double[] getMinMax(){
        Hashtable h;
        double value;
        double range[] = {Double.POSITIVE_INFINITY,Double.NEGATIVE_INFINITY};
        for(Enumeration e = table.elements();e.hasMoreElements();){
            h = (Hashtable)e.nextElement();
            for(Enumeration f = h.elements();f.hasMoreElements();){
                value = ((Double)f.nextElement()).doubleValue();
                range[0] = Math.min(value,range[0]);
                range[1] = Math.max(value,range[1]);
            }
        }    
        return range;
    }
    
    public int getColCount(){
        return colCount;
    }
    
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -