コード例 #1
0
 public BondLocation(List<Location> subLocations) {
   super();
   Location min = Tools.getMin(subLocations);
   Location max = Tools.getMax(subLocations);
   setStart(min.getStart());
   setEnd(max.getEnd());
   setStrand(Strand.UNDEFINED);
   setSubLocations(subLocations);
   assertLocation();
 }
コード例 #2
0
 public OneOfLocation(List<Location> locations) {
   super();
   if (locations.isEmpty()) {
     throw new IllegalArgumentException("Need locations to build a OneOfLocation");
   }
   Location l = locations.get(0);
   setStart(l.getStart());
   setEnd(l.getEnd());
   setStrand(l.getStrand());
   setBetweenCompounds(l.isBetweenCompounds());
   setCircular(l.isCircular());
   setSubLocations(locations);
 }
コード例 #3
0
 @Override
 protected final void assertLocation() {
   for (Location l : this) {
     Point start = l.getStart();
     Point end = l.getEnd();
     if (!start.equals(end)) {
       throw new IllegalStateException(
           "The start "
               + start
               + " is not equal to the end "
               + end
               + ". bond locations must be a single "
               + "compound long");
     }
   }
 }