/plugins/JFuguePlugin/tags/release-0-7-1/src/java/com/townsfolkdesigns/jfugue/gen/AbstractMusicGenerator.java

# · Java · 63 lines · 17 code · 8 blank · 38 comment · 0 complexity · 8fc042226b41acfe608d1c77bf1881f4 MD5 · raw file

  1. /*
  2. * JFugue Plugin is a plugin for jEdit that provides basic functionality and
  3. * access to JFugue.
  4. * Copyright (C) 2007 Eric Berry
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version 2
  9. * of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. /**
  21. *
  22. */
  23. package com.townsfolkdesigns.jfugue.gen;
  24. import java.util.List;
  25. /**
  26. * @author elberry
  27. *
  28. */
  29. public abstract class AbstractMusicGenerator<A, T extends MusicTransform> implements MusicGenerator<A, T> {
  30. private List<T> musicTransforms;
  31. /* (non-Javadoc)
  32. * @see com.townsfolkdesigns.jfugue.gen.MusicGenerator#addTransform(com.townsfolkdesigns.jfugue.gen.AbstractMusicTransform)
  33. */
  34. public void addTransform(T musicTransform) {
  35. getMusicTransforms().add(musicTransform);
  36. }
  37. /* (non-Javadoc)
  38. * @see com.townsfolkdesigns.jfugue.gen.MusicGenerator#removeTransform(com.townsfolkdesigns.jfugue.gen.AbstractMusicTransform)
  39. */
  40. public boolean removeTransform(T musicTransform) {
  41. return getMusicTransforms().remove(musicTransform);
  42. }
  43. /**
  44. * @return the musicTransforms
  45. */
  46. protected List<T> getMusicTransforms() {
  47. return musicTransforms;
  48. }
  49. /**
  50. * @param musicTransforms the musicTransforms to set
  51. */
  52. protected void setMusicTransforms(List<T> musicTransforms) {
  53. this.musicTransforms = musicTransforms;
  54. }
  55. }