Java Code Examples for org.hy.common.Help#print()
The following examples show how to use
org.hy.common.Help#print() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JU_Formula.java From hy.common.report with Apache License 2.0 | 6 votes |
/** * 测试:解释Excel公式中的单元格ID * * @author ZhengWei(HY) * @createDate 2020-05-21 * @version v1.0 * */ @Test public void test_parserFormula() { String [] v_Formulas = {"=A1 + B1" ,"=A1 - B1" ,"=A1 * B1" ,"=A1 / B1" ,"=A1 / B1 + C1 - D1 * E1" ,"=$A1 / B$1 + $C$1 - D1 * E1" ,"=$A1 / B$1 + A1 + B1 + $C$1 - D1 * E1" }; for (String v_Formula : v_Formulas) { System.out.println("\n\n" + v_Formula); Help.print(ExcelFormula.parserFormula(v_Formula)); } }
Example 2
Source File: JU_Help.java From hy.common.base with Apache License 2.0 | 6 votes |
@Test public void test_toSortByMap() { Counter<String> v_Counter = new Counter<String>(); String [] v_ABC = {"A" ,"B" ,"C" ,"D" ,"E" ,"F" ,"G" ,"H" ,"I" ,"J" ,"K" ,"M" ,"N"}; for (int i=0; i<10; i++) { v_Counter.put(v_ABC[i] ,Help.random(10)); } System.out.println("-- 正排序Map.value"); Help.print(Help.toSortByMap( v_Counter)); System.out.println("\n-- 倒排序Map.value"); Help.print(Help.toReverseByMap(v_Counter)); }
Example 3
Source File: JU_Help.java From hy.common.base with Apache License 2.0 | 5 votes |
public void test_toList() { List<JU_XJSON> v_Datas = new ArrayList<JU_XJSON>(); v_Datas.add(new JU_XJSON("00" ,"1" ,1)); v_Datas.add(new JU_XJSON("01" ,"10" ,2)); v_Datas.add(new JU_XJSON("02" ,"11" ,3)); System.out.println("\n\n按SID列抽取"); Help.print(Help.toList(v_Datas ,"SID")); System.out.println("\n\n按doubleValue列抽取"); Help.print(Help.toList(v_Datas ,"doubleValue")); }
Example 4
Source File: JU_ReadVertical.java From hy.common.report with Apache License 2.0 | 5 votes |
@Test public void test_ReadHorizontal() { RTemplate v_RTemplate = (RTemplate)XJava.getObject("ReadVertical"); List<?> v_Datas = ReportHelp.toJava(v_RTemplate ,JU_ReadVertical.class.getResource("JU_ReadVertical_Datas.xlsx").toString()); Help.print(v_Datas); }
Example 5
Source File: JU_ReadHorizontal.java From hy.common.report with Apache License 2.0 | 5 votes |
@Test public void test_ReadHorizontal() { RTemplate v_RTemplate = (RTemplate)XJava.getObject("ReadHorizontal"); List<?> v_Datas = ReportHelp.toJava(v_RTemplate ,JU_ReadHorizontal.class.getResource("JU_ReadHorizontal_Datas.xlsx").toString()); Help.print(v_Datas); }
Example 6
Source File: JU_ReadVerticalGrade.java From hy.common.report with Apache License 2.0 | 5 votes |
@Test public void test_JU_ReadVerticalGrade() { RTemplate v_RTemplate = (RTemplate)XJava.getObject("ReadVerticalGrade"); List<?> v_Datas = ReportHelp.toJava(v_RTemplate ,JU_ReadVerticalGrade.class.getResource("JU_ReadVerticalGrade_Datas.xlsx").toString()); Help.print(v_Datas); }
Example 7
Source File: JU_SumList.java From hy.common.base with Apache License 2.0 | 5 votes |
@Test public void test() { SumList<Param> v_SumList = new SumList<Param>(); v_SumList.setSplit(";"); v_SumList.setConnectors(","); v_SumList.setKeyMethodURL("name"); v_SumList.setMethodURLs("value;comment"); for (int i=1; i<=10; i++) { Param v_Item = new Param("N" + (i % 2) ,"V" + i ,"C" + i); v_Item.setOnlyRead(false); v_SumList.add(v_Item); } Help.print(v_SumList); if ( v_SumList.size() == 2 ) { if ( "V1,V3,V5,V7,V9".equals(v_SumList.get(0).getValue()) ) { if ( "C1,C3,C5,C7,C9".equals(v_SumList.get(0).getComment()) ) { assertTrue(true); return; } } } assertTrue(false); }
Example 8
Source File: JU_Help.java From hy.common.base with Apache License 2.0 | 5 votes |
@Test public void test_getClasses() { List<Class<?>> v_Ret = Help.getClasses("org.hy.common.一个不存在包名"); Help.print(v_Ret); }
Example 9
Source File: JU_Help.java From hy.common.base with Apache License 2.0 | 5 votes |
/** * 测试数据排序 * * @author ZhengWei(HY) * @createDate 2016-02-20 * @version v1.0 * */ public void test_SortArray() { System.out.println("-- 测试元素个数为偶数的倒序排序"); Help.print(Help.toReverse(new int[]{1 ,2 ,3 ,4})); System.out.println("-- 测试元素个数为奇数的倒序排序"); Help.print(Help.toReverse(new int[]{1 ,2 ,3})); }
Example 10
Source File: JU_Help.java From hy.common.base with Apache License 2.0 | 5 votes |
public void test_toDistinct() { List<JU_XJSON> v_Datas = new ArrayList<JU_XJSON>(); v_Datas.add(new JU_XJSON("00" ,"1" ,1)); v_Datas.add(new JU_XJSON("01" ,"10" ,2)); v_Datas.add(new JU_XJSON("02" ,"11" ,3)); v_Datas.add(new JU_XJSON("00" ,"111" ,4)); v_Datas.add(new JU_XJSON("03" ,"2" ,5)); System.out.println("\n\n重除显示"); Help.toDistinct(v_Datas ,"SID"); Help.print(v_Datas); }
Example 11
Source File: JU_Comparate.java From hy.common.base with Apache License 2.0 | 5 votes |
@Test public void test_Comparate() { String [] v_A = new String[]{"1"}; String [] v_B = new String[]{"2"}; ComparateResult<String []> v_CR = Comparate.comparate(v_A ,v_B); System.out.println("新增数据:"); Help.print(v_CR.getNewData()); System.out.println("删除数据:"); Help.print(v_CR.getDelData()); }
Example 12
Source File: JU_Help.java From hy.common.base with Apache License 2.0 | 5 votes |
@Test public void test_toSortByNum() { System.out.println("\n\n正序排序。不改变数据格式"); Help.print(Help.toSortByNum("3.1" ,"3.0" ,"3.010")); System.out.println("\n\n倒序排序。不改变数据格式"); Help.print(Help.toReverseByNum("3.1" ,"3.0" ,"3.010")); }
Example 13
Source File: JU_Help.java From hy.common.base with Apache License 2.0 | 5 votes |
@Test public void test_toMap() throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { System.out.println("-- 排序返回"); Help.print(Help.toMap(new JU_XJSON())); System.out.println("\n-- 随机返回"); Help.print(Help.toMap(new JU_XJSON() ,null ,true ,false)); System.out.println("2015/09/29".replaceAll("/" ,"-")); }
Example 14
Source File: JU_Help.java From hy.common.base with Apache License 2.0 | 5 votes |
@Test public void test_findSames() { List<String> v_Datas = new ArrayList<String>(); List<String> v_Sames = null; for (int i=0; i<10; i++) { v_Datas.add("" + i); } // 生成重复的数据 for (int i=0; i<3; i++) { v_Datas.add("" + i); } // 再生成第二次重复的数据 for (int i=0; i<3; i++) { v_Datas.add("" + i); } v_Sames = Help.findSames(v_Datas); System.out.println("\n-- 查找重复的元素"); Help.print(v_Sames); Assert.assertTrue(v_Sames.size() == 3); }
Example 15
Source File: JU_Help.java From hy.common.base with Apache License 2.0 | 5 votes |
@Test public void test_toLike() { String [] v_Arrs = new String[100]; List<String> v_Strs = new ArrayList<String>(); List<JU_XJSON> v_Datas = new ArrayList<JU_XJSON>(); for (int i=1; i<=100; i++) { JU_XJSON v_Data = new JU_XJSON(); v_Data.setBODY(new JU_XJSON_BODYType()); v_Data.setSID("" + i); v_Data.getBODY().setStaffId("" + i); v_Datas.add(v_Data); v_Strs .add("" + i); v_Arrs[i - 1] = "" + i; } System.out.println("List对象xx.yy.zz测试"); Help.print(Help.toLike(v_Datas ,"body.staffid" ,true ,"1")); System.out.println("List对象直属属性测试"); Help.print(Help.toLike(v_Datas ,"sid" ,true ,"1" ,"2")); System.out.println("List简单类型集合测试"); Help.print(Help.toLike(v_Strs ,true ,"0" ,"2")); System.out.println("数组简单类型测试"); Help.print(Help.toLike(v_Arrs ,true ,"3" ,"1")); }
Example 16
Source File: JU_Help.java From hy.common.base with Apache License 2.0 | 5 votes |
@Test public void test_executeCommand() { Help.print(Help.executeCommand("ls -aln /")); // Help.print(Help.executeCommand("ls" ,"-aln" ,"/")); // Help.print(Help.executeCommand("GBK" ,false ,"cmd.exe /c d: && cd D:\\apache-tomcat-7.0.47\\bin && D:\\apache-tomcat-7.0.47\\bin\\shutdown.bat")); // Help.print(Help.executeCommand("GBK" ,false ,"cmd.exe" ,"/c" ,"dir" ,"c:\\")); }
Example 17
Source File: JU_Help.java From hy.common.base with Apache License 2.0 | 4 votes |
@Test public void test_toSort() { List<JU_XJSON> v_Datas = new ArrayList<JU_XJSON>(); v_Datas.add(new JU_XJSON("00" ,"1" ,1)); v_Datas.add(new JU_XJSON("01" ,"10" ,2)); v_Datas.add(new JU_XJSON("02" ,"11" ,3)); v_Datas.add(new JU_XJSON("00" ,"111" ,4)); v_Datas.add(new JU_XJSON("03" ,"2" ,5)); System.out.println("\n\n按SID倒序排序"); Help.toSort(v_Datas ,"SID Desc" ,"BODY.hyDate Desc"); Help.print(v_Datas); System.out.println("\n\n按SID正序排序"); Help.toSort(v_Datas ,"SID"); Help.print(v_Datas); System.out.println("\n\n按SID倒序、SIGN倒排序"); Help.toSort(v_Datas ,"SID Desc" ,"SIGN Desc"); Help.print(v_Datas); System.out.println("\n\n按SID倒序、SIGN正排序"); Help.toSort(v_Datas ,"SID Desc" ,"SIGN"); Help.print(v_Datas); System.out.println("\n\n按SID倒序、时间倒排序"); Help.toSort(v_Datas ,"SID Desc" ,"REQTIME Desc"); Help.print(v_Datas); System.out.println("\n\n按doubleValue倒序排序"); Help.toSort(v_Datas ,"doubleValue Desc"); Help.print(v_Datas); System.out.println("\n\n按SIGN数字倒排序"); Help.toSort(v_Datas ,"SIGN NumDesc"); Help.print(v_Datas); System.out.println("\n\n按SIGN数字正排序"); Help.toSort(v_Datas ,"SIGN NumAsc"); Help.print(v_Datas); System.out.println("\n\n按SIGN正排序"); Help.toSort(v_Datas ,"SIGN Asc"); Help.print(v_Datas); System.out.println("\n\n按SIGN倒排序。并有错误排序属性名的情况下"); Help.toSort(v_Datas ,"2015 Desc" ,"SIGN Desc" ,"2016 Asc"); Help.print(v_Datas); }
Example 18
Source File: JU_Help.java From hy.common.base with Apache License 2.0 | 4 votes |
@Test public void test_executeCommand_otherExe() { Help.print(Help.executeCommand(false ,false ,"/Volumes/HY_HD_06/Develop_HD/apache-tomcat-7.0.47/bin/startup.sh")); System.exit(0); }