SimpleProfile implements Profile<S, C> { @Override public List<C> getCompoundsAt(int alignmentIndex) { List<C> column = new ArrayList<C>(); for (AlignedSequence<S, C> s : list) { column.add(s.getCompoundAt(alignmentIndex)); } return Collections.unmodifiableList(column); } protected  SimpleProfile(AlignedSequence<S, C> query, AlignedSequence<S, C> target);  SimpleProfile(S sequence); protected  SimpleProfile(S query, S target, List<Step> sx, int xb, int xa, List<Step> sy, int yb, int ya); protected  SimpleProfile(Profile<S, C> query, Profile<S, C> target, List<Step> sx, List<Step> sy);  SimpleProfile(Collection<AlignedSequence<S,C>> alignedSequences); @Override AlignedSequence<S, C> getAlignedSequence(int listIndex); @Override AlignedSequence<S, C> getAlignedSequence(S sequence); @Override List<AlignedSequence<S, C>> getAlignedSequences(); @Override List<AlignedSequence<S, C>> getAlignedSequences(int... listIndices); @Override List<AlignedSequence<S, C>> getAlignedSequences(S... sequences); @Override C getCompoundAt(int listIndex, int alignmentIndex); @Override C getCompoundAt(S sequence, int alignmentIndex); @Override int[] getCompoundCountsAt(int alignmentIndex); @Override int[] getCompoundCountsAt(int alignmentIndex, List<C> compounds); @Override List<C> getCompoundsAt(int alignmentIndex); @Override CompoundSet<C> getCompoundSet(); @Override float[] getCompoundWeightsAt(int alignmentIndex); @Override float[] getCompoundWeightsAt(int alignmentIndex, List<C> compounds); @Override int getIndexOf(C compound); @Override int[] getIndicesAt(int alignmentIndex); @Override int getLastIndexOf(C compound); @Override int getLength(); @Override List<S> getOriginalSequences(); @Override int getSize(); @Override ProfileView<S, C> getSubProfile(Location location); @Override boolean hasGap(int alignmentIndex); @Override boolean isCircular(); @Override String toString(int width); @Override String toString(StringFormat format); @Override String toString(); @Override Iterator<AlignedSequence<S, C>> iterator();  }
@Test public void testGetCompoundsAt() { List<AminoAcidCompound> column = global.getCompoundsAt(5); assertEquals(column.size(), 2); assertEquals(column.get(0).getShortName(), "-"); assertEquals(column.get(1).getShortName(), "G"); column = local.getCompoundsAt(2); assertEquals(column.size(), 2); assertEquals(column.get(0).getShortName(), "N"); assertEquals(column.get(1).getShortName(), "-"); column = single.getCompoundsAt(2); assertEquals(column.size(), 1); assertEquals(column.get(0).getShortName(), "R"); }
@Test(expected=IndexOutOfBoundsException.class) public void testGetCompoundsAtOutOfBounds() { global.getCompoundsAt(0); }
@Test(expected=IndexOutOfBoundsException.class) public void testGetCompoundsAtOutOfBounds2() { global.getCompoundsAt(6); }
@Test(expected=IndexOutOfBoundsException.class) public void testGetCompoundsAtOutOfBounds3() { local.getCompoundsAt(0); }
@Test(expected=IndexOutOfBoundsException.class) public void testGetCompoundsAtOutOfBounds4() { local.getCompoundsAt(4); }
@Test(expected=IndexOutOfBoundsException.class) public void testGetCompoundsAtOutOfBounds5() { single.getCompoundsAt(0); }
@Test(expected=IndexOutOfBoundsException.class) public void testGetCompoundsAtOutOfBounds6() { single.getCompoundsAt(5); }