@Test public void getLeastFret() throws Exception { assertThat(mChords.get(0).getLeastFret(), is(1)); assertThat(mChords.get(1).getLeastFret(), is(3)); assertThat(mChords.get(2).getLeastFret(), is(5)); assertThat(mChords.get(3).getLeastFret(), is(8)); }
public int getLeastFret() { int leastFret = -1; for (int i = 0; i < frets.length; i++) { int fret = frets[i]; if (fret < 1) { continue; } if (leastFret == -1) { leastFret = fret; continue; } if (fret < leastFret) { leastFret = fret; } } return leastFret; }
Chord { public int getLeastFret() { int leastFret = -1; for (int i = 0; i < frets.length; i++) { int fret = frets[i]; if (fret < 1) { continue; } if (leastFret == -1) { leastFret = fret; continue; } if (fret < leastFret) { leastFret = fret; } } return leastFret; } }
Chord { public int getLeastFret() { int leastFret = -1; for (int i = 0; i < frets.length; i++) { int fret = frets[i]; if (fret < 1) { continue; } if (leastFret == -1) { leastFret = fret; continue; } if (fret < leastFret) { leastFret = fret; } } return leastFret; } Chord();  Chord(int[] frets);  Chord(int[] frets, int[] fingers); }
Chord { public int getLeastFret() { int leastFret = -1; for (int i = 0; i < frets.length; i++) { int fret = frets[i]; if (fret < 1) { continue; } if (leastFret == -1) { leastFret = fret; continue; } if (fret < leastFret) { leastFret = fret; } } return leastFret; } Chord();  Chord(int[] frets);  Chord(int[] frets, int[] fingers); int[] getFrets(); void setFrets(int[] frets); int[] getFingers(); void setFingers(int[] fingers); boolean isEmptyString(); boolean isClosedString(); int getLeastFret(); int getLargestFret(); int getFret(int string); @Override String toString(); }
Chord { public int getLeastFret() { int leastFret = -1; for (int i = 0; i < frets.length; i++) { int fret = frets[i]; if (fret < 1) { continue; } if (leastFret == -1) { leastFret = fret; continue; } if (fret < leastFret) { leastFret = fret; } } return leastFret; } Chord();  Chord(int[] frets);  Chord(int[] frets, int[] fingers); int[] getFrets(); void setFrets(int[] frets); int[] getFingers(); void setFingers(int[] fingers); boolean isEmptyString(); boolean isClosedString(); int getLeastFret(); int getLargestFret(); int getFret(int string); @Override String toString(); static final int STRING; }