Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. package wgu.model;
  2.  
  3. import javafx.beans.property.SimpleDoubleProperty;
  4. import javafx.beans.property.SimpleIntegerProperty;
  5. import javafx.beans.property.SimpleStringProperty;
  6.  
  7. import java.util.concurrent.atomic.AtomicInteger;
  8.  
  9. /**
  10. * Created by jreis on 2/9/2017.
  11. */
  12. public abstract class Part {
  13.  
  14. private static AtomicInteger next_id = new AtomicInteger(0);
  15. private SimpleStringProperty partName;
  16. private SimpleDoubleProperty partPrice;
  17. private SimpleIntegerProperty partInstock;
  18. private SimpleIntegerProperty partMin;
  19. private SimpleIntegerProperty partMax;
  20. private SimpleIntegerProperty partID;
  21.  
  22. //Setters and Getters
  23. public void setPartName(String name) {
  24. this.partName.set(name);
  25. }
  26.  
  27. public String getPartName() {
  28. return partName.get();
  29. }
  30.  
  31. public SimpleStringProperty partNameProperty() {
  32. return partName;
  33. }
  34.  
  35. public void setPartPrice(Double price) {
  36. this.partPrice.set(price);
  37. }
  38.  
  39. public Double getPartPrice() {
  40. return partPrice.get();
  41. }
  42.  
  43. public SimpleDoubleProperty partPriceProperty() {
  44. return partPrice;
  45. }
  46.  
  47. public void setPartInstock(int amt) {
  48. this.partInstock.set(amt);
  49. }
  50.  
  51. public int getPartInstock() {
  52. return partInstock.get();
  53. }
  54.  
  55. public SimpleIntegerProperty partInStockProperty() {
  56. return partInstock;
  57. }
  58.  
  59. public void setPartMin(int min) {
  60. this.partMin.set(min);
  61. }
  62.  
  63. public int getPartMin() {
  64. return partMin.get();
  65. }
  66.  
  67. public SimpleIntegerProperty partMinProperty() {
  68. return partMin;
  69. }
  70.  
  71. public void setPartMax(int max) {
  72. this.partMax.set(max);
  73. }
  74.  
  75. public int getPartMax() {
  76. return partMax.get();
  77. }
  78.  
  79. public SimpleIntegerProperty partMaxProperty() {
  80. return partMax;
  81. }
  82.  
  83. public void setPartID(int id) {
  84. this.partID.set(id);
  85. }
  86.  
  87. public int getPartID() {
  88. return partID.get();
  89. }
  90.  
  91. public SimpleIntegerProperty partIDProperty() {
  92. return partID;
  93. }
  94.  
  95. //Constructors
  96. public Part() {
  97. // this.partID.set(next_id.incrementAndGet());
  98. }
  99.  
  100. public Part(SimpleIntegerProperty ID, SimpleStringProperty name, SimpleDoubleProperty partPrice, SimpleIntegerProperty partInstock) {
  101. this.partID = ID;
  102. this.partName = name;
  103. this.partPrice = partPrice;
  104. this.partInstock = partInstock;
  105.  
  106. }
  107.  
  108.  
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement