HolonTransformer.java 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package classes;
  2. public class HolonTransformer extends CpsObject {
  3. /* Ratio of the transformer */
  4. float transformRatio;
  5. /*Fixed transform value */
  6. float transformFixed;
  7. /**
  8. * Constructor Set type of object (Transformer), its transform ratio and the
  9. * default name ("Transformer");
  10. */
  11. public HolonTransformer(String ObjName) {
  12. super(ObjName);
  13. }
  14. public HolonTransformer(String ObjName, String obj) {
  15. super(ObjName);
  16. super.setName(obj);
  17. }
  18. public HolonTransformer(CpsObject obj) {
  19. super(obj);
  20. this.setTransformRatio(((HolonTransformer) obj).getTransformRatio());
  21. }
  22. /**
  23. * Set transform ratio
  24. *
  25. * @param ratio
  26. * desired ratio
  27. */
  28. public void setTransformRatio(float ratio) {
  29. this.transformRatio = ratio;
  30. }
  31. /**
  32. * Output the actual ratio of the transformer
  33. *
  34. * @return actual ratio of the transformer
  35. */
  36. public float getTransformRatio() {
  37. return this.transformRatio;
  38. }
  39. /**
  40. * Set fixed Transform Value
  41. *
  42. * @param fixed
  43. * desired fixed Transform Value
  44. */
  45. public void setTransformFixed(float fixed) {
  46. this.transformFixed = fixed;
  47. }
  48. /**
  49. * Output the actual fixed Transform Value
  50. *
  51. * @return actual fixed Transform Value
  52. */
  53. public float getTransformFixed() {
  54. return this.transformFixed;
  55. }
  56. }