HolonTransformer.java 886 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package classes;
  2. public class HolonTransformer extends CpsObject {
  3. /* Ratio of the transformer */
  4. float transformRatio;
  5. /**
  6. * Constructor Set type of object (Transformer), its transform ratio and the
  7. * default name ("Transformer");
  8. */
  9. public HolonTransformer(String ObjName) {
  10. super(ObjName);
  11. }
  12. public HolonTransformer(String ObjName, String obj) {
  13. super(ObjName);
  14. super.setName(obj);
  15. }
  16. public HolonTransformer(CpsObject obj) {
  17. super(obj);
  18. this.setTransformRatio(((HolonTransformer) obj).getTransformRatio());
  19. }
  20. /**
  21. * Set transform ratio
  22. *
  23. * @param ratio
  24. * desired ratio
  25. */
  26. public void setTransformRatio(float ratio) {
  27. this.transformRatio = ratio;
  28. }
  29. /**
  30. * Output the actual ratio of the transformer
  31. *
  32. * @return actual ratio of the transformer
  33. */
  34. public float getTransformRatio() {
  35. return this.transformRatio;
  36. }
  37. }