IPInfoDataModel.java~8~
资源名称:Java.rar [点击查看]
上传用户:liming9091
上传日期:2014-10-27
资源大小:3376k
文件大小:2k
源码类别:
Java编程
开发平台:
Java
- package tsinghuaip;
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- import javax.swing.table.*;
- import javax.swing.event.*;
- import com.borland.jbcl.layout.*;
- import javax.swing.border.*;
- import java.util.*;
- import java.math.*;
- public class IPInfoDataModel extends AbstractTableModel {
- private Object[][] arrIPInfo;
- private Vector startIPVector;
- private Vector endIPVector;
- private Vector localVector;
- public IPInfoDataModel() {
- SAXParseIPInfo parseIPInfo = new SAXParseIPInfo();
- try {
- parseIPInfo.ParseIPInfo();
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- startIPVector = parseIPInfo.GetStartIPVector();
- endIPVector = parseIPInfo.GetEndIPVector();
- localVector = parseIPInfo.GetLocalVector();
- int intLen = startIPVector.size();
- arrIPInfo = new Object[intLen][3];
- for (int i = 0; i < intLen; i++) {
- arrIPInfo[i] = new Object[3];
- }
- for (int m = 0; m < intLen; m++) {
- arrIPInfo[m][0] = startIPVector.elementAt(m);
- arrIPInfo[m][1] = endIPVector.elementAt(m);
- arrIPInfo[m][2] = localVector.elementAt(m);
- }
- }
- public int getColumnCount() {
- return arrIPInfo[0].length;
- }
- public int getRowCount() {
- return arrIPInfo.length;
- }
- public Object getValueAt(int row, int col) {
- return arrIPInfo[row][col];
- }
- public boolean isCellEditable(int row, int col) {
- return false;
- }
- }