コード例 #1
0
 public Vector getAssociatedLevelLists() {
   Vector levelLists = new Vector();
   Vector endPts = CollectionHelper.makeVector("Keyword");
   Hashtable keywordParents =
       oncotcap.Oncotcap.getDataSource()
           .getParentTree(
               "Keyword", endPts, CollectionHelper.makeVector(this), TreeDisplayModePanel.ROOT);
   // Take each of the parents and get the associated level lists
   if (keywordParents.size() <= 0) return levelLists;
   Hashtable levelListsHashtable =
       oncotcap.Oncotcap.getDataSource()
           .getInstanceTree(
               "EnumLevelList",
               new Vector(),
               makeLevelListFilter(keywordParents),
               TreeDisplayModePanel.ROOT);
   for (Enumeration e = keywordParents.keys(); e.hasMoreElements(); ) {
     System.out.println("Keyword.getAssociatedLevelLists: " + e.nextElement());
   }
   // Collect all the level lists from the hashtable
   Vector selectedItems = CollectionHelper.makeVector(keyword);
   for (Enumeration e = levelListsHashtable.keys(); e.hasMoreElements(); ) {
     Object obj = e.nextElement();
     if (obj instanceof EnumLevelList) {
       levelLists.addElement(obj);
     }
   }
   return levelLists;
 }
コード例 #2
0
 private void initSetterMap() {
   Method setter = null;
   setter = getSetter("setKeyword", String.class);
   setMethodMap.put("keyword", setter);
   setter = getSetter("setParents", DefaultPersistibleList.class);
   setMethodMap.put("parentKeyword", setter);
   setter = getSetter("setDescribedInstances", DefaultPersistibleList.class);
   setMethodMap.put("describedInstances", setter);
   //  				setter = getSetter("getSubordinateKeywords");
   //  				getMethodMap.put("subordinateKeywords", setter);
 }
コード例 #3
0
 private void initGetterMap() {
   Method getter = null;
   getter = getGetter("getKeyword");
   getMethodMap.put("keyword", getter);
   getter = getGetter("getParents");
   getMethodMap.put("parentKeyword", getter);
   getter = getGetter("getDescribedInstances");
   getMethodMap.put("describedInstances", getter);
   // 		getter = getGetter("getSubordinateKeywords");
   // 				getMethodMap.put("subordinateKeywords", getter);
 }
コード例 #4
0
  private void addKeyword(Hashtable table, Keyword word, Keyword parent) {
    boolean recurse = true;

    if (table.containsKey(word)) recurse = false;

    if (parent == null) table.put(word, String.valueOf(-1));
    else table.put(word, parent);

    if (recurse) {
      Iterator it = word.getChildren().iterator();
      while (it.hasNext()) {
        addKeyword(table, (Keyword) it.next(), word);
      }
    }
  }
コード例 #5
0
 private OncFilter makeLevelListFilter(Hashtable keywords) {
   // Create a filter
   OncFilter filter = new OncFilter(false);
   OncTreeNode rootNode = filter.getRootNode();
   OncTreeNode orNode = new OncTreeNode(TcapLogicalOperator.OR, Persistible.DO_NOT_SAVE);
   OncTreeNode keywordNode;
   for (Enumeration e = keywords.keys(); e.hasMoreElements(); ) {
     Object obj = e.nextElement();
     if (obj instanceof Keyword) orNode.add(new OncTreeNode(obj, (Persistible.DO_NOT_SAVE)));
   }
   rootNode.add(orNode);
   return filter;
 }
コード例 #6
0
 public Method getGetMethod(String name) {
   if (name != null) return (Method) getMethodMap.get(name);
   else return null;
 }