资源简介
环境:eclipse3.7.2 jre1.6
代码片段和文件信息
import java.awt.frame;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import javax.swing.JFileChooser;
/**
* @author wd
*
*/
public class CreateFile extends frame {
private static final long serialVersionUID = 7863555841628851148L;
private static final String currentDirectory = “.“;
private static final String txtFile = “.txt“;
private static final String txtFileName = “文本文件(*.txt)“;
private static final String csvFile = “.csv“;
private static final String csvFileName = “csv文件(*.csv)“;
private static final String zero = “0“;
private static final String Charset = “UTF-8“;
private static final String colon = “:“;
private static final String space = “ “;
private static final String nan = “NaN“;
private static final String[] key = {“借出者“ “全“ “秒标“ “净标“ “普通“ “快标“ “阳光“};
private static final String empty = ““;
private static final String lineBreak = “\r\n“;
private ArrayList names;
private ArrayList values;
public CreateFile() {
this.names = new ArrayList();
this.values = new ArrayList();
}
private int findIndex(String name) {
for (int i = 0; i < names.size(); i++) {
if (name.equalsIgnoreCase(names.get(i))) {
return i;
}
}
return -1;
}
private String getValue(int index) {
return this.values.get(index);
}
private String getString(ArrayList values) {
String value = empty;
for (int i = 0; i < values.size(); i ++) {
value += ““ + values.get(i);
}
return value;
}
private String diagram1(String name) {
int index;
String rate = zero;
ArrayList valueList = new ArrayList();
index = findIndex(name + key[1]);
if (index == -1) {
valueList.add(zero);
} else {
valueList.add(getValue(index));
rate = getValue(index + 1);
}
index = findIndex(name + key[0]);
if (index == -1) {
valueList.add(zero);
} else {
valueList.add(getValue(index));
}
valueList.add(rate);
return getString(valueList);
}
private String diagram2(String name) {
int index;
ArrayList valueList = new ArrayList();
for (int i = 1; i < 5; i++) {
index = findIndex(name + key[i]);
if (index == -1) {
valueList.add(zero);
} else {
valueList.add(getValue(index));
}
}
return getString(valueList);
}
private String diagram3(String name) {
int index;
ArrayList valueList = new ArrayList();
for (int i = 2; i < 5; i++) {
index = findIndex(name + key[i]);
if (index == -1) {
valueList.add(zero);
} else {
valueLi
- 上一篇:java的C/S架构实现的远程考试系统
- 下一篇:JSP编程技术源代码.rar
相关资源
- mysql数据处理,java用户登录处理
- 法律咨询信息系统(java+jsp+sqlserver)
- Java快速开发平台源码(renren-fast)
- 锐聘学院QST青软JavaWeb十二个打包
- 3.3.6微信支付JAVA版demo
- javaweb网上购物系统源码(附数据库脚
- javaweb校园宿舍系统(附数据库脚本)
- JavaWeb书城项目(附数据库脚本)
- 基于JAVA_JSP电子书系统(源码+数据库
- Java网络编程知识点总结.xmind
- 一站式Java网络编程 BIO-NIO-AIO资料源码
- jsp讲解
- 基于SSH框架的JavaWeb项目—人员信息管
- javaweb实现的邮件收发系统(附数据库
- Java 仿QQ(附客户端以及服务端源码)
- Java TCP IP Socket
- java定时发送邮件(基于quartz)
- Java Swing开发的《星际争霸》游戏
- java+数据库商品交易管理系统(附数据
- 使用java语言编译一个计算器
- java swing工资管理系统(源码+数据库
- JAVALibrary
- 微信企业号回调模式Java版
- 顺丰丰桥接口开发详细教程源码含下
- Java博客概要设计文档
- 药品进销存管理系统(论文范文_JSP
- 奖学金管理系统java+jsp+mysql
- 毕设参考——基于java酒店管理
- Java写的一个简单的字体更改程序
- java8学习教程之lambda表达式的使用方法
评论
共有 条评论