Package com.projity.pm.key

Examples of com.projity.pm.key.HasKey


        loadResources.execute(project);
        resourceNodeMap.clear();
        project.getResourcePool().getResourceOutline().getHierarchy().visitAll(new Closure(){
          public void execute(Object o) {
            Node node=(Node)o;
            HasKey k=(HasKey)node.getImpl();
            resourceNodeMap.put(k.getUniqueId(), node);
          }

        });
      }
View Full Code Here


    visitAll(new Closure(){
      private int index=0;
      public void execute(Object o) {
        Node node=(Node)o;
        if (node.hasNumber()){
          HasKey impl=(HasKey)node.getImpl();
          if (impl.getId()!=++index){
            impl.setId(index);
          }
        }
      }
    });
  }
View Full Code Here

*/
public class Finder {
  public static Object findByName(Object find, Collection container) {
    Iterator i = container.iterator();
    String id = (String)find;
    HasKey current;
    while (i.hasNext()) {
      current = (HasKey)i.next();
      if (current.getName().equals(id))
        return current;
    }
    return null;
  }
View Full Code Here

    return null;
  }
  public static Object findById(Object find, Collection container) {
    Iterator i = container.iterator();
    int id = ((Integer)find).intValue();
    HasKey current;
    while (i.hasNext()) {
      current = (HasKey)i.next();
      if (current.getId() == id)
        return current;
    }
    return null;
  }
View Full Code Here

  }
  //TODO this is a temporary implementation.  Should work with hash table or check server
  public static Object findByUniqueId(Object find, Collection container) {
    Iterator i = container.iterator();
    long uniqueId = ((Long)find).longValue();
    HasKey current;
    while (i.hasNext()) {
      current = (HasKey)i.next();
      if (current.getUniqueId() == uniqueId)
        return current;
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of com.projity.pm.key.HasKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.