Yotam Harchol | f25e814 | 2013-09-09 14:30:13 -0700 | [diff] [blame^] | 1 | |
| 2 | @Override |
| 3 | public List<OFAction> getActions()throws UnsupportedOperationException { |
| 4 | //:: if builder: |
| 5 | if (!this.instructionsSet) |
| 6 | //:: if has_parent: |
| 7 | return parentMessage.getActions(); |
| 8 | //:: else: |
| 9 | return Collections.emptyList(); |
| 10 | //:: #endif |
| 11 | //:: #endif |
| 12 | ImmutableList.Builder<OFAction> builder = ImmutableList.builder(); |
| 13 | for (OFInstruction inst : this.instructions) { |
| 14 | if (inst instanceof OFInstructionApplyActions) { |
| 15 | OFInstructionApplyActions iap = (OFInstructionApplyActions)inst; |
| 16 | builder.addAll(iap.getActions()); |
| 17 | } |
| 18 | } |
| 19 | return builder.build(); |
| 20 | } |