/*
* 文件名:Test.java
* 版权:Copyright 2000-2007 晏新锋
* 描述: 重构-改善既有代码的设计
* 修改人: 晏新锋
* 修改时间:2009-10-13
* 修改内容:新增
* 跟踪单号:
* 修改单号:
* 修改内容:
*/
package test;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
/**
* 〈一句话功能简述〉
* 〈功能详细描述〉
* @author 晏新锋
* @version V1.00 2009-10-13
* @see [相关类/方法]
* @since 重构-改善既有代码的设计
*/
public class Test
{
public static void main(String[] args)
{
String varName = "";
String varValue = "";
List<String> list = new ArrayList<String>();
StringTokenizer string = new StringTokenizer(
"[SubscriberNumber] = $1 AND [AcceptTime] between $2 AND $3 AND [SubscriberNumber] = $4 AND [AcceptTime111] between $2 AND $3 ",
"[]");
while (string.hasMoreTokens())
{
list.add(string.nextToken());
}
for (int i = 0; i < list.size() / 2; i++ )
{
varName = list.get(i + (i * 1));
String varValueTemp = list.get(i + (i * 1) + 1);
String[] strings = varValueTemp.split("\\$");
for (int j = 0; j < strings.length; j++ )
{
String string3 = strings[j];
String string6 = string3.substring(0, string3.indexOf(" "));
if ( !string6.equals(""))
{
//System.out.println(string6);
varValue = string6;
System.out.println(varName + ":$" + varValue);
}
}
}
}
}
* 文件名:Test.java
* 版权:Copyright 2000-2007 晏新锋
* 描述: 重构-改善既有代码的设计
* 修改人: 晏新锋
* 修改时间:2009-10-13
* 修改内容:新增
* 跟踪单号:
* 修改单号:
* 修改内容:
*/
package test;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
/**
* 〈一句话功能简述〉
* 〈功能详细描述〉
* @author 晏新锋
* @version V1.00 2009-10-13
* @see [相关类/方法]
* @since 重构-改善既有代码的设计
*/
public class Test
{
public static void main(String[] args)
{
String varName = "";
String varValue = "";
List<String> list = new ArrayList<String>();
StringTokenizer string = new StringTokenizer(
"[SubscriberNumber] = $1 AND [AcceptTime] between $2 AND $3 AND [SubscriberNumber] = $4 AND [AcceptTime111] between $2 AND $3 ",
"[]");
while (string.hasMoreTokens())
{
list.add(string.nextToken());
}
for (int i = 0; i < list.size() / 2; i++ )
{
varName = list.get(i + (i * 1));
String varValueTemp = list.get(i + (i * 1) + 1);
String[] strings = varValueTemp.split("\\$");
for (int j = 0; j < strings.length; j++ )
{
String string3 = strings[j];
String string6 = string3.substring(0, string3.indexOf(" "));
if ( !string6.equals(""))
{
//System.out.println(string6);
varValue = string6;
System.out.println(varName + ":$" + varValue);
}
}
}
}
}