# HG changeset patch # User one # Date 1414360148 -32400 # Node ID 0fce1292ab38cb5f540831b380a99e2631a917f4 # Parent f59fc20f4af92a0eb612b8ad8fbf5f00904e15b6 add deepPersonIdsTest and Method but not Test diff -r f59fc20f4af9 -r 0fce1292ab38 src/main/java/jp/ac/u_ryukyu/cr/ie/tatsuki/bbs/JuGrix.java --- a/src/main/java/jp/ac/u_ryukyu/cr/ie/tatsuki/bbs/JuGrix.java Mon Oct 27 04:49:58 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/cr/ie/tatsuki/bbs/JuGrix.java Mon Oct 27 06:49:08 2014 +0900 @@ -56,6 +56,10 @@ return personIdsSearch(orgId, roleIds).iterator(); } + public LinkedList personIdLink(String orgId, LinkedList roleIds){ + return personIdsSearch(orgId, roleIds); + } + public Iterator personIds(LinkedList orgIds ,LinkedList roleIds){ LinkedList personIds = new LinkedList(); @@ -425,6 +429,24 @@ return pairPersonIterator; } + + + public Iterator deepPersonIds(String orgId, LinkedList filterIds) { + + Iterator childrensIterator = deepChildOrganizationIds(orgId, new LinkedList()); + if (!childrensIterator.hasNext()) + return new NullIterator(); + + LinkedList childrenPersonList = new LinkedList(); + childrenPersonList.addAll(personIdLink(orgId, filterIds)); + for (;childrensIterator.hasNext();) { + String id = childrensIterator.next(); + childrenPersonList.addAll(personIdLink(id, filterIds)); + } + + return childrenPersonList.iterator(); + } + public Iterator deepChildOrganizationIds(String orgId, LinkedList filterIds) { return _deepChildOrganizationIds(orgId,filterIds).iterator(); } @@ -602,4 +624,6 @@ + + } diff -r f59fc20f4af9 -r 0fce1292ab38 src/test/java/jp/ac/u_ryukyu/cr/ie/tatsuki/functionTest/deepPersonIdsTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/test/java/jp/ac/u_ryukyu/cr/ie/tatsuki/functionTest/deepPersonIdsTest.java Mon Oct 27 06:49:08 2014 +0900 @@ -0,0 +1,23 @@ +package jp.ac.u_ryukyu.cr.ie.tatsuki.functionTest; + +import java.util.Iterator; +import java.util.LinkedList; + +import jp.ac.u_ryukyu.cr.ie.tatsuki.bbs.JuGrix; + +import org.junit.Test; + +public class deepPersonIdsTest { + @Test + public void deepPersonIdsTest(){ + JuGrix jugrix = new JuGrix(); + LinkedList filterIds = new LinkedList(); + //filterIds.add("r:9"); + Iterator ids = jugrix.deepPersonIds("o:3",filterIds); + System.out.println("------------------------------------------------"); + for (;ids.hasNext();) { + System.out.println(ids.next()); + } + } + +}