/** * Used to create an instance of a specific stopwords scheme. * * @return a suitably configured <code>StopwordsHandler</code> value */ @Override public StopwordsHandler getStopwords() { return new Rainbow(); }
/** * Used to create an instance of a specific stopwords scheme. * * @return a suitably configured <code>StopwordsHandler</code> value */ @Override public StopwordsHandler getStopwords() { return new Rainbow(); }
void showDetails(int position) { FragmentManager fm = getFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); int color; switch (position) { case 0: color = Color.BLUE; break; case 1: color = Color.RED; break; default: color = Color.WHITE; } Rainbow rainbow = new Rainbow(); Bundle arguments = new Bundle(); arguments.putInt("color", color); rainbow.setArguments(arguments); ft.replace(R.id.titles, rainbow); ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); ft.addToBackStack(null); ft.commit(); return; }
Red red = new Red(); Blue blue = new Blue(); Rainbow rainbow = new Rainbow(); rainbow.add(red); rainbow.add(blue); if (rainbow.getTypeOfColor("Yellow") == null) { //Color doesn't exist } if (rainbow.getTypeOfColor("Red") != null) { //Color exists }
/** * Used to create an instance of a specific stopwords scheme. * * @return a suitably configured <code>StopwordsHandler</code> value */ @Override public StopwordsHandler getStopwords() { MultiStopwords result; StopwordsHandler[] handlers; result = new MultiStopwords(); handlers = new StopwordsHandler[3]; handlers[0] = new Rainbow(); handlers[1] = new WordsFromFile(); ((WordsFromFile) handlers[1]).setStopwords(new File(getTmpDirectory() + File.separator + "WordsFromFile.txt")); handlers[2] = new RegExpFromFile(); ((RegExpFromFile) handlers[2]).setStopwords(new File(getTmpDirectory() + File.separator + "RegExpFromFile.txt")); result.setStopwords(handlers); return result; }
/** * Used to create an instance of a specific stopwords scheme. * * @return a suitably configured <code>StopwordsHandler</code> value */ @Override public StopwordsHandler getStopwords() { MultiStopwords result; StopwordsHandler[] handlers; result = new MultiStopwords(); handlers = new StopwordsHandler[3]; handlers[0] = new Rainbow(); handlers[1] = new WordsFromFile(); ((WordsFromFile) handlers[1]).setStopwords(new File(getTmpDirectory() + File.separator + "WordsFromFile.txt")); handlers[2] = new RegExpFromFile(); ((RegExpFromFile) handlers[2]).setStopwords(new File(getTmpDirectory() + File.separator + "RegExpFromFile.txt")); result.setStopwords(handlers); return result; }