/farmR/src/java/src/jfm/model/ELSOptionComponent.java

https://code.google.com/p/javawfm/ · Java · 40 lines · 17 code · 6 blank · 17 comment · 0 complexity · 6fbe6295c8454d8a488da76715adc685 MD5 · raw file

  1. /**
  2. *
  3. */
  4. package jfm.model;
  5. import jfm.lp.ModelComponent;
  6. import jfm.lp.ModelComponent.MCType;
  7. import jfm.lp.MatrixVariable;
  8. import jfm.model.ELSOption;
  9. import jfm.model.Types.ELSCode;
  10. import java.util.*;
  11. /**
  12. * @author iracooke
  13. *
  14. */
  15. public abstract class ELSOptionComponent extends ModelComponent {
  16. protected HashMap<ELSCode,ELSOption> options=new HashMap<ELSCode,ELSOption>();
  17. public Set<ELSOption> getOptions(){
  18. HashSet<ELSOption> rv = new HashSet<ELSOption>(options.values());
  19. return Collections.unmodifiableSet(rv);
  20. }
  21. ELSOptionComponent(MCType type_){
  22. super(type_);
  23. };
  24. /* protected ELSOption getOption(ELSCode code){
  25. for(ELSOption eo:options){
  26. if ( eo.code==code){
  27. return eo;
  28. }
  29. }
  30. throw new Error("Option "+code+" not found ");
  31. }*/
  32. }