示例#1
0
  /**
   * This does not add a vote
   *
   * @param d_SK
   * @param crt_justification
   */
  public static void addJustificationToDSSK(DD_SK d_SK, D_Justification crt_justification) {
    if (crt_justification != null) {
      // skip if no GID
      String jGID = crt_justification.getGID();
      if (jGID == null) return;
      // skip if already in
      for (D_Justification old_j : d_SK.just) {
        if (Util.equalStrings_and_not_null(old_j.getGID(), jGID)) return;
      }

      d_SK.just.add(crt_justification);
      addConstituentToDSSK(d_SK, crt_justification.getConstituentForce());
      addMotionToDSSK(d_SK, crt_justification.getMotionForce());
    }
  }
示例#2
0
 /**
  * @param d_SK
  * @param crt_justification
  * @param voting_constituent
  * @param alreadySupported
  */
 public static void addJustificationWithAnySupportToDSSK(
     DD_SK d_SK,
     D_Justification crt_justification,
     D_Constituent voting_constituent,
     boolean alreadySupported) {
   addJustificationToDSSK(d_SK, crt_justification);
   if (alreadySupported) return;
   D_Motion crt_motion = crt_justification.getMotionForce();
   D_Vote my_vote =
       D_Vote.getOneBroadcastedSupportForJustification(
           crt_motion, crt_justification, voting_constituent, crt_motion.getSupportChoice());
   if (my_vote != null) {
     addVoteIfNew(d_SK, my_vote);
     addConstituentToDSSK(d_SK, my_vote.getConstituent_force());
   }
 }