Package com.projity.association

Examples of com.projity.association.AssociationList


    }
  }

  private void addAssignments(Node node){
    if (node.getImpl() instanceof HasAssignments){
      AssociationList assignments=((HasAssignments)node.getImpl()).getAssignments();
      if (assignments==null) return;
      for (ListIterator i=assignments.listIterator(assignments.size());i.hasPrevious();){
        Assignment assignment=(Assignment)i.previous();
        if (assignment.isDefault()) continue;
        Node assignmentNode=NodeFactory.getInstance().createNode(assignment);
        node.insert(assignmentNode,0);
      }
View Full Code Here


              //check assignments, if resource not present change it to unassigned

              for (int s=0;s<Settings.numBaselines();s++){
                TaskSnapshot snapshot=(TaskSnapshot)task.getSnapshot(new Integer(s));
                    if (snapshot==null) continue;
                  AssociationList snapshotAssignments=snapshot.getHasAssignments().getAssignments();
                  if (snapshotAssignments.size()>0){
//                    ArrayList<Assignment> assignmentsToLink=new ArrayList<Assignment>();
                      for (Iterator a=snapshotAssignments.listIterator();a.hasNext();){
                          Assignment assignment=(Assignment)a.next();
                          Resource resource=assignment.getResource();
                      if (resource==ResourceImpl.getUnassignedInstance()) continue;
                      Resource destResource=resourceMap.get(resource.getUniqueId());
                      if (destResource!=null){
View Full Code Here

  private void writeObject(ObjectOutputStream s) throws IOException {
      s.defaultWriteObject();
  }
  private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException  {
      s.defaultReadObject();
      predecessors = new AssociationList();
      successors = new AssociationList();
  }
View Full Code Here

//TODO scheduling rule and effort driven don't make sense for resources, so make them go away?
  int schedulingRule = ScheduleOption.getInstance().getSchedulingRule();
  boolean effortDriven = ScheduleOption.getInstance().isEffortDriven();

  public HasAssignmentsImpl() {
    assignments = new AssociationList();
  }
View Full Code Here

      throw new InternalError();
    }
  }
  public Object cloneWithTask(Task task){
      HasAssignmentsImpl clone=(HasAssignmentsImpl)clone();
      clone.assignments=new AssociationList();

      //TODO doesn't work when it's copied between projects
      Iterator i = assignments.iterator();
      while (i.hasNext()) {
        clone.assignments.add(((Assignment)i.next()).cloneWithTask(task));
View Full Code Here

      return clone;
  }
  public Object cloneWithResource(Resource resource){
    HasAssignmentsImpl clone=(HasAssignmentsImpl)clone();
    clone.assignments=new AssociationList();
    Iterator i = assignments.iterator();
    while (i.hasNext()) {
      clone.assignments.add(((Assignment)i.next()).cloneWithResource(resource));
    }
View Full Code Here

   * (which could be the default assignment), use the assignment duration
   * @param workCalendar
   * @return
   */
  public long calcActiveAssignmentDuration(WorkCalendar workCalendar) {
    AssociationList assignments =getAssignments();
    // Most of the time there is just one assignment. If that's the case, use the assignment duration
    if (assignments.size() == 1)
      return ((Assignment)assignments.getFirst()).getDurationMillis();
    AssignmentDurationSummer summer = new AssignmentDurationSummer(workCalendar);
    forEachWorkingInterval(summer,false,workCalendar);
    return summer.getSum();

  }
View Full Code Here

  private void writeObject(ObjectOutputStream s) throws IOException {
      s.defaultWriteObject();
  }
  private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException  {
      s.defaultReadObject();
      assignments = new AssociationList();
  }
View Full Code Here

      if (s == Snapshottable.CURRENT.intValue())
        continue;
      TaskSnapshot snapshot = (TaskSnapshot) projityTask.getSnapshot(new Integer(s));
      if (snapshot == null)
        continue;
      AssociationList snapshotAssignments = snapshot.getHasAssignments().getAssignments();
      if (snapshotAssignments.size() > 0) {
        for (Iterator j = snapshotAssignments.iterator(); j.hasNext();) {
          Assignment assignment = (Assignment) j.next();
          ResourceImpl r = (ResourceImpl) assignment.getResource();
          if (r.isDefault())
            continue;
View Full Code Here

    return currentSchedule;
  }
 
  public static TaskSnapshotBackup backup(TaskSnapshot snapshot,boolean backupSchedule){
    if (snapshot==null) return null;
    AssociationList assignments=snapshot.getAssignments();
    Iterator i = assignments.iterator();
    Assignment assignment;
    ArrayList detail=new ArrayList(assignments.size());
    while (i.hasNext()) {
      assignment = (Assignment)i.next();
      detail.add(assignment.backupDetail());
    }
    return new TaskSnapshotBackup(snapshot.getCurrentSchedule(),detail);
View Full Code Here

TOP

Related Classes of com.projity.association.AssociationList

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.