tailieunhanh - Applied Java Patterns Stephen phần 6

Thay đổi thành phần của một hỗn hợp có nghĩa là bạn có thể để thay đổi hành vi của Composites. Không có vấn đề bạn đang ở đâu trong cơ cấu cây, bạn có thể gọi phương thức tương tự trên mỗi của các thành phần cá nhân. | 71. updateStartDate newStartDate 72. currentAppointment appointment 73. return true 74. 75. return false 76. 77. 78. public boolean changeAppointment Appointment appointment Date possibleDates 79. AppointmentTransactionParticipant participants long transactionID 80. try 81. for int i 0 i i 82. if participants i .join transactionID 83. return false 84. 85. 86. for int i 0 i i 87. if isDateAvailable transactionID appointment possibleDates i participants 88. try 89. commitAll transactionID participants 90. return true 91. 92. catch TransactionException exc 93. 94. 95. 96. catch RemoteException exc 97. try 98. cancelAll transactionID participants 99. 100. catch RemoteException exc 101. return false 102. 103. 104. private boolean isDateAvailable long transactionID Appointment appointment 105. Date date AppointmentTransactionParticipant participants 106. try 107. for int i 0 i i 108. try 109. if participants i .changeDate transactionID appointment date 110. return false 111. 112. 113. catch TransactionException exc 114. return false 115. 116. 117. 118. catch RemoteException exc 119. return false 120. 121. return true 122. 123. private void commitAll long transactionID AppointmentTransactionParticipant participants 124. throws TransactionException RemoteException 125. for int i 0 i i 126. participants i .commit transactionID 127. 128. 129. private void cancelAll long transactionID AppointmentTransactionParticipant participants 130. throws RemoteException 131. for int i 0 i i 132. participants i .cancel transactionID 133. 134. 135. public String toString 136. return serviceName .toString 137. 138. 182 Part II Patterns in the Java Programming Language Chapter 5. Introduction to Java Programming Language Patterns In the first part of this book a common set of patterns is discussed. The patterns are listed with descriptions of their characteristics the .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.