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(); }
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); }
@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"); } } }