<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    guanxf

    我的博客:http://blog.sina.com.cn/17learning

      BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      71 隨筆 :: 1 文章 :: 41 評(píng)論 :: 0 Trackbacks

    2016年4月29日 #


    createTree(1, orgNodeTree, sameOrgNodes, 0);


    @NoArgsConstructor
    @AllArgsConstructor
    @Getter
    @Setter
    public class NodeTree {
    private String pName;
    private String name;
    private int level;
    private List<NodeTree> children;
    }

    private void createTree(int leave, int ind, Map<String, NodeTree> pIndexNodeNameMap, List<NodeVo> childNodes) {
    Map<String, NodeTree> cIndexNodeNameMap = new HashMap();
    //構(gòu)建樹(shù)
    int treeNo = pIndexNodeNameMap.size();
    if (treeNo == 0) {
    return;
    }
    int group = 0;
    for (int i = ind; i < childNodes.size(); i++) {
    NodeVo node = childNodes.get(i);
    long index = node.getId() % treeNo;
    NodeTree pNode = pIndexNodeNameMap.get(index + "");
    List<NodeTree> children = pNode.getChildren();
    if (CollectionUtils.isEmpty(children)) {
    children = new ArrayList();
    }
    if (children.size() > 2) {
    leave++;
    createTree(leave, i, cIndexNodeNameMap, childNodes);
    break;
    } else {
    NodeTree child = new NodeTree();
    child.setLevel(leave);
    child.setPName(pNode.getName());
    child.setName(node.getNodeName());
    children.add(child);
    pNode.setChildren(children);
    cIndexNodeNameMap.put(group + "", child);
    group++;
    }
    }
    }


    private boolean createTree(int level, List<NodeTree> parentNodes, List<NodeVo> childNodes, int beginIndex) {
    //構(gòu)建樹(shù)
    List<NodeTree> nextLevelNodes = new ArrayList<>();
    for (int i = beginIndex; i < childNodes.size(); i++) {
    int parentCount = 1;
    for (NodeTree pNode : parentNodes) {
    List<NodeTree> children = pNode.getChildren();
    if (CollectionUtils.isEmpty(children)) {
    children = new ArrayList();
    pNode.setChildren(children);
    }
    if (children.size() >= 3) {
    if(parentCount >= parentNodes.size()){
    return createTree(++level, nextLevelNodes, childNodes, beginIndex);
    }
    } else {
    if (beginIndex >= childNodes.size()) {
    return true;
    }
    NodeTree child = new NodeTree();
    child.setLevel(level);
    child.setPName(pNode.getName());
    NodeVo node = childNodes.get(beginIndex);
    child.setName(node.getNodeName());
    pNode.getChildren().add(child);
    nextLevelNodes.add(child);
    beginIndex++;
    }
    parentCount++;
    }
    }
    return true;
    }
    posted @ 2020-09-07 09:56 管先飛 閱讀(256) | 評(píng)論 (0)編輯 收藏

    執(zhí)行命名:
    git pull github master --allow-unrelated-histories

    執(zhí)行結(jié)果如下:

    E:\WorkSpace\workspaceJ2ee\abocode\jfaster>git pull github master --allow-unrelated-histories
    remote: Counting objects: 3, done.
    remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 3
    Unpacking objects: 100% (3/3), done.
    From https://github.com/abocode/jfaster
     * branch            master     -> FETCH_HEAD
     * [new branch]      master     -> github/master
    Merge made by the 'recursive' strategy.
     .gitattributes | 3 +++
     1 file changed, 3 insertions(+)
     create mode 100644 .gitattributes
    posted @ 2018-05-20 12:30 管先飛 閱讀(316) | 評(píng)論 (0)編輯 收藏

    進(jìn)入“控制面板”——“用戶賬戶”-憑據(jù)管理器——windows憑據(jù)

    找到了git的用戶名密碼。修改正確后ok

    posted @ 2018-05-20 12:29 管先飛 閱讀(262) | 評(píng)論 (0)編輯 收藏

    元注解:

      元注解的作用就是負(fù)責(zé)注解其他注解。Java5.0定義了4個(gè)標(biāo)準(zhǔn)的meta-annotation類型,它們被用來(lái)提供對(duì)其它 annotation類型作說(shuō)明。Java5.0定義的元注解:
        1.@Target,
        2.@Retention,
        3.@Documented,
        4.@Inherited

      這些類型和它們所支持的類在java.lang.annotation包中可以找到。下面我們看一下每個(gè)元注解的作用和相應(yīng)分參數(shù)的使用說(shuō)明。
    以下為一個(gè)簡(jiǎn)單場(chǎng)景的應(yīng)用:
     1.定義注解:
       
    @Target(TYPE)
    @Retention(RUNTIME)
    public @interface Table {
    /**
    * (Optional) The name of the table.
    * <p/>
    * Defaults to the entity name.
    */
    String name() default "";
    }
    @Target({METHOD, FIELD})
    @Retention(RUNTIME)
    public @interface Column {

    /**
    * (Optional) The name of the column. Defaults to
    * the property or field name.
    */
    String name() default "";
    }
    2、定義實(shí)體類:
      

    @Table(name = "t_s_user")
    public class User {
    @Column(name="name")
    private String name;

    @Column(name="pwd")
    private String pwd;

    public String getName() {
    return name;
    }

    public void setName(String name) {
    this.name = name;
    }

    public String getPwd() {
    return pwd;
    }

    public void setPwd(String pwd) {
    this.pwd = pwd;
    }
    }

    3、運(yùn)行:

    public static void print() {
    System.out.println("table's name" + User.class.getAnnotation(Table.class).name());
    Field[] fields = User.class.getDeclaredFields();
    for (int i = 0; i < fields.length; i++) {
    Field field = fields[i];
    System.out.println("field's type:" + field.getType().getName());
    System.out.println("field's columnName:" + field.getAnnotation(Column.class).name());
    }
    }

    關(guān)于注解的詳細(xì)介紹:http://www.cnblogs.com/peida/archive/2013/04/24/3036689.html
    posted @ 2016-08-18 20:42 管先飛 閱讀(2836) | 評(píng)論 (0)編輯 收藏

    1.選擇:File->project structure->libraries

    2.左上角選擇添加,選擇添加java(還提供了添加maven項(xiàng)目),然后選擇所需要的目錄:

    3.idea 會(huì)提示選擇添加什么類型的文件,我們是單純的文件,所以選擇classes

       

     
    posted @ 2016-04-29 15:42 管先飛 閱讀(1697) | 評(píng)論 (0)編輯 收藏

    主站蜘蛛池模板: 蜜芽亚洲av无码一区二区三区 | 亚洲av乱码一区二区三区| 免免费国产AAAAA片| 久久水蜜桃亚洲AV无码精品| 国产AV无码专区亚洲AV手机麻豆 | 国产一级做a爱免费视频| 中文字幕视频在线免费观看| www.亚洲成在线| ZZIJZZIJ亚洲日本少妇JIZJIZ | 免费a级毛片18以上观看精品| 免费精品久久天干天干| 亚洲精品免费网站| 国产精一品亚洲二区在线播放 | 亚洲国产美女精品久久| 2022中文字字幕久亚洲| 亚洲第一网站免费视频| 一级看片免费视频囗交| 亚洲一本大道无码av天堂| 亚洲色偷拍另类无码专区| 91嫩草国产在线观看免费| 又长又大又粗又硬3p免费视频| 老色鬼久久亚洲AV综合| 亚洲国产成人精品女人久久久| 国产92成人精品视频免费| AAAAA级少妇高潮大片免费看| 亚洲中文字幕乱码熟女在线| 亚洲第一AAAAA片| 亚洲国产高清在线一区二区三区| 曰曰鲁夜夜免费播放视频 | 久久久综合亚洲色一区二区三区 | 亚洲av纯肉无码精品动漫| 亚洲精品国产免费| 国产亚洲综合网曝门系列| 亚洲国产成人精品无码久久久久久综合| av免费不卡国产观看| 午夜无码A级毛片免费视频 | 精品剧情v国产在免费线观看 | 久久精品亚洲男人的天堂| 日本最新免费不卡二区在线| 131美女爱做免费毛片| 一级毛片免费不卡在线|