コード例 #1
0
 public static List<PeriodicTemporalConstraint> getPeriodicConstraints(
     EPlanElement element, boolean mustExist) {
   ConstraintsMember constraintsMember = element.getMember(ConstraintsMember.class, mustExist);
   if (constraintsMember == null) {
     return Collections.emptyList();
   }
   return constraintsMember.getPeriodicTemporalConstraints();
 }
コード例 #2
0
 private Set<PeriodicTemporalConstraint> getRelevantConstraints(ConstraintsMember facet) {
   Set<PeriodicTemporalConstraint> result = new LinkedHashSet<PeriodicTemporalConstraint>();
   for (PeriodicTemporalConstraint constraint : facet.getPeriodicTemporalConstraints()) {
     if (isRelevantConstraint(constraint)) {
       result.add(constraint);
     }
   }
   return result;
 }
コード例 #3
0
 public static List<PeriodicTemporalConstraint> getPeriodicConstraints(
     EPlanElement element, Timepoint timepoint, boolean mustExist) {
   ConstraintsMember constraintsMember = element.getMember(ConstraintsMember.class, mustExist);
   if (constraintsMember == null) {
     return Collections.emptyList();
   }
   List<PeriodicTemporalConstraint> result = new ArrayList<PeriodicTemporalConstraint>();
   for (PeriodicTemporalConstraint constraint :
       constraintsMember.getPeriodicTemporalConstraints()) {
     ConstraintPoint point = constraint.getPoint();
     if ((point.getElement() == element) && (point.getEndpoint() == timepoint)) {
       result.add(constraint);
     }
   }
   return result;
 }
コード例 #4
0
 public static void detachConstraint(final PeriodicTemporalConstraint constraint) {
   ConstraintsMember member =
       constraint.getPoint().getElement().getMember(ConstraintsMember.class, true);
   member.getPeriodicTemporalConstraints().remove(constraint);
 }