@Test public void getBarreChordData() throws Exception { assertThat(mChordHelper.getBarreChordData(mChords.get(0)), nullValue()); assertThat(mChordHelper.getBarreChordData(mChords.get(1)), is(new int[]{3, 6})); assertThat(mChordHelper.getBarreChordData(mChords.get(2)), is(new int[]{5, 5})); assertThat(mChordHelper.getBarreChordData(mChords.get(3)), is(new int[]{8, 6})); assertThat(mChordHelper.getBarreChordData(mChords.get(4)), nullValue()); assertThat(mChordHelper.getBarreChordData(mChords.get(5)), is(new int[]{1, 4})); assertThat(mChordHelper.getBarreChordData(mChords.get(6)), is(new int[]{1, 2})); }
public int[] getBarreChordData(Chord chord) { int[] data = new int[2]; boolean emptyString = chord.isEmptyString(); if (emptyString) { int withFirstString = getWithFirstString(chord); if (firstStringLeast(chord) && withFirstString > 1) { data[0] = chord.getLeastFret(); data[1] = withFirstString; } else { return null; } } else { if (chord.isClosedString()) { data[0] = chord.getLeastFret(); data[1] = getMaxUnClosedString(chord); } else { data[0] = chord.getLeastFret(); data[1] = Chord.STRING; } } return data; }
ChordHelper { public int[] getBarreChordData(Chord chord) { int[] data = new int[2]; boolean emptyString = chord.isEmptyString(); if (emptyString) { int withFirstString = getWithFirstString(chord); if (firstStringLeast(chord) && withFirstString > 1) { data[0] = chord.getLeastFret(); data[1] = withFirstString; } else { return null; } } else { if (chord.isClosedString()) { data[0] = chord.getLeastFret(); data[1] = getMaxUnClosedString(chord); } else { data[0] = chord.getLeastFret(); data[1] = Chord.STRING; } } return data; } }
ChordHelper { public int[] getBarreChordData(Chord chord) { int[] data = new int[2]; boolean emptyString = chord.isEmptyString(); if (emptyString) { int withFirstString = getWithFirstString(chord); if (firstStringLeast(chord) && withFirstString > 1) { data[0] = chord.getLeastFret(); data[1] = withFirstString; } else { return null; } } else { if (chord.isClosedString()) { data[0] = chord.getLeastFret(); data[1] = getMaxUnClosedString(chord); } else { data[0] = chord.getLeastFret(); data[1] = Chord.STRING; } } return data; }  }
ChordHelper { public int[] getBarreChordData(Chord chord) { int[] data = new int[2]; boolean emptyString = chord.isEmptyString(); if (emptyString) { int withFirstString = getWithFirstString(chord); if (firstStringLeast(chord) && withFirstString > 1) { data[0] = chord.getLeastFret(); data[1] = withFirstString; } else { return null; } } else { if (chord.isClosedString()) { data[0] = chord.getLeastFret(); data[1] = getMaxUnClosedString(chord); } else { data[0] = chord.getLeastFret(); data[1] = Chord.STRING; } } return data; }  int[] getBarreChordData(Chord chord); boolean firstStringLeast(Chord chord); int getWithFirstString(Chord chord); int getMaxUnClosedString(Chord chord); }
ChordHelper { public int[] getBarreChordData(Chord chord) { int[] data = new int[2]; boolean emptyString = chord.isEmptyString(); if (emptyString) { int withFirstString = getWithFirstString(chord); if (firstStringLeast(chord) && withFirstString > 1) { data[0] = chord.getLeastFret(); data[1] = withFirstString; } else { return null; } } else { if (chord.isClosedString()) { data[0] = chord.getLeastFret(); data[1] = getMaxUnClosedString(chord); } else { data[0] = chord.getLeastFret(); data[1] = Chord.STRING; } } return data; }  int[] getBarreChordData(Chord chord); boolean firstStringLeast(Chord chord); int getWithFirstString(Chord chord); int getMaxUnClosedString(Chord chord);  }