public Flashcard getPreviousCard() { if (hasActiveCards()) { while (true) { cardIndex--; if (cardIndex < 0) { cardIndex = flashcards.size() - 1; } activeCard = flashcards.get(cardIndex); if (activeCard.getActive()) { return activeCard; } } } return activeCard; }
public Flashcard getNextCard() { if (hasActiveCards()) { while (true) { cardIndex++; if (cardIndex == flashcards.size()) { cardIndex = 0; } activeCard = flashcards.get(cardIndex); if (activeCard.getActive()) { return activeCard; } } } return activeCard; }