`
53873039oycg
  • 浏览: 840171 次
  • 性别: Icon_minigender_1
社区版块
存档分类
最新评论
文章列表
有时候不得不对数据手动排序分组,下面是一个简单的例子。        public void testSortListMap(){ List<Map<String, String>> retList = new ArrayList<Map<String, String>>(); Map<String, String> map2 = new HashMap<String, String>(); map2.put("createdate", "2014-10-01 03:0 ...
       public void analyseData3(double[] scores, int maxScore, int passScore, int step, boolean mergeBelowPass) { int num = 0, start = 0, end = -1; if (!mergeBelowPass) { num = maxScore / step; end = maxScore / step * step; start = 0; } else { num = (maxScore - passScor ...
        public void scoreRank() { Double[] scoreArr = new Double[9]; scoreArr[2] = scoreArr[4] = 66.5; scoreArr[0] = scoreArr[5] = 67d; scoreArr[1] = scoreArr[3] = scoreArr[6] = 66.4; scoreArr[7] = 68d; scoreArr[8] = 66.2; List<Double> doubleList = Arrays.asList(scoreArr) ...
        public static void printManifestContent(Manifest mf) { Attributes attributes = mf.getMainAttributes(); Set<Entry<Object, Object>> entrySet = attributes.entrySet(); for (Iterator iterator = entrySet.iterator(); iterator.hasNext();) { Entry<Object, Object> ent ...
              Excel的条件格式可以使用poi的 Conditional Format实现,代码:       //>=60 SheetConditionalFormatting condFmt = sheet.getSheetConditionalFormatting(); ConditionalFormattingRule condRule = condFmt.createConditionalFormattingRule(ComparisonOperator.GE, "60"); FontFor ...

[简单]代码片段_4

    博客分类:
  • java
        很早前随手写的,欢迎提出更好的写法。          import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.net.InetSocketAddre ...
          以前使用poi操作word 2007时候会遇到设置页面大小等问题,当时发现1cm≈567,为什么要这样一直不清楚,今天发现一篇关于这方面的文章。           文章链接:http://startbigthinksmall.wordpress.com/2010/01/04/points-inches-and-emus-measuring-units-in-office-open-xml/,打不开的同学请看下面的图片。                                 1cm≈567 (567=1*20*72/2.54)   。     文章作者提供了 ...

[简单]代码片段_3

    博客分类:
  • poi
       下面的代码很简单,替换参数功能很早前有人写过,而且写的还不错,直接贴代码。        import java.io.FileOutputStream; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import org.apache.poi.POIXMLDocument; import org.apache.poi.xwpf.usermodel.X ...
        直接上代码:         import java.io.File; import java.math.BigInteger; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; import org.docx4j.jaxb.Context; imp ...
         直接上代码:          import java.io.FileOutputStream; import java.math.BigInteger; import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.apache.poi.xwpf.usermodel.XWPFFootnotes; import org.apache.poi.xwpf.usermodel.XWPFParagraph; import org.apache.poi. ...
       本文非原创,只是整理了下代码,原代码出自:http://blog.chiefleo.me/archives/429.原文如下:              普通的读取批注信息方法:       public void readWordDocxComments(String fileName) { XWPFDocument document = null; XWPFComment[] comments = null; try { document = new XWPFDocument(POIXMLDocument.openPackage(fileNa ...
       直接上代码:        import java.io.FileOutputStream; import java.math.BigInteger; import java.util.ArrayList; import java.util.List; import java.util.Random; import org.apache.poi.xwpf.usermodel.BreakType; import org.apache.poi.xwpf.usermodel.ParagraphAlignment; import org.apache.poi.xw ...
         直接上代码:          import java.io.FileOutputStream; import java.math.BigInteger; import java.util.Random; import org.apache.poi.xwpf.usermodel.BreakType; import org.apache.poi.xwpf.usermodel.ParagraphAlignment; import org.apache.poi.xwpf.usermodel.TextAlig ...

[简单]代码片段_2

    博客分类:
  • java
      import java.io.File; import java.net.URL; import java.net.URLClassLoader; import java.util.ArrayList; import java.util.List; import org.apache.commons.lang3.StringUtils; public class 打印Jar_S3_Test { public static void main(String[] args) { 打印Jar_S3_Test t = new 打印Jar_S3_Test() ...

[非技术]随记_2

       [ 64.15.113.191 ] [ 173.194.121.51 ] [ 64.15.113.232 ] [ 74.125.205.50 ] [ 64.233.169.53 ] [ 173.194.68.97 ] [ 209.116.186.221 ] [ 74.125.233.100 ] [ 173.194.118.149 ] [ 74.125.71.47 ] [ 74.125.25.165 ] [ 173.194.125.88 ] [ ...
Global site tag (gtag.js) - Google Analytics