📄 tculists.java
字号:
/**
*
*/
package com.jr81.source.xml.source;
import java.io.IOException;
/**
* @author yanslat
*
*/
public class TcuLists {
private TcuInterfaceXmlLists Lists = null;
public TcuLists(int type) {
if (type == 0) {
Lists = new TcuXmlVectorLists();
} else if (type == 1) {
Lists = new TcuXmlMapLists();
}
}
public void Clear() {
Lists.Clear();
}
public int GetCount() {
return Lists.GetCount();
}
public int GetLength() {
return Lists.GetLength();
}
public void AddList(TcuXmlList value) {
Lists.AddList(value);
}
public void AddList(byte[] name, byte[] value) {
Lists.AddList(name,value);
}
public void AddList(byte[] name, byte[] value, int type) {
Lists.AddList(name, value, type);
}
public void DeleteList(int index) {
Lists.DeleteList(index);
}
public void DeleteList(String name) {
Lists.DeleteList(name);
}
public TcuXmlList GetList(int index) {
return Lists.GetList(index);
}
public TcuXmlList GetList(String name) {
return Lists.GetList(name);
}
public byte[] GetListByteValue (String name) {
return Lists.GetListByteValue(name);
}
public String GetListStrValue(String name) {
return Lists.GetListStrValue(name);
}
public void Assign(TcuLists value) {
Lists.Assign(value);
}
public boolean FromByteXml(byte[] value) {
return Lists.FromByteXml(value);
}
public byte[] ToByteXml() throws IOException {
return Lists.ToByteXml();
}
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
TcuLists Lists = new TcuLists(1);
TcuXmlList tmpList = new TcuXmlList();
tmpList.setName("颜斌".getBytes());
tmpList.setValue("hahah".getBytes());
Lists.AddList(tmpList);
String dd = new String(Lists.ToByteXml());
System.out.println(dd);
TcuLists Lists1 = new TcuLists(1);
Lists1.FromByteXml(Lists.ToByteXml());
String dd1 = new String(Lists1.ToByteXml());
System.out.println(dd1);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -