protected List<UnclosedBranchDescriptor> getBranchesForParent(PactConnection toParent) {
		if (this.outgoingConnections.size() == 1) {
			// return our own stack of open branches, because nothing is added
			if (this.openBranches == null || this.openBranches.isEmpty()) {
				return Collections.emptyList();
			} else {
				return new ArrayList<UnclosedBranchDescriptor>(this.openBranches);
			}
		}
		else if (this.outgoingConnections.size() > 1) {
			// we branch add a branch info to the stack
			List<UnclosedBranchDescriptor> branches = new ArrayList<UnclosedBranchDescriptor>(4);
			if (this.openBranches != null) {
				branches.addAll(this.openBranches);
			}

			// find out, which output number the connection to the parent
			int num;
			for (num = 0; num < this.outgoingConnections.size(); num++) {
				if (this.outgoingConnections.get(num) == toParent) {
					break;
				}
			}
			if (num >= this.outgoingConnections.size()) {
				throw new CompilerException("Error in compiler: "
					+ "Parent to get branch info for is not contained in the outgoing connections.");
			}

			// create the description and add it
			long bitvector = 0x1L << num;
			branches.add(new UnclosedBranchDescriptor(this, bitvector));
			return branches;
		}
		else {
			throw new CompilerException(
				"Error in compiler: Cannot get branch info for successor in a node with no successors.");
		}
	}
protected List < UnclosedBranchDescriptor > getBranchesForParent ( PactConnection toParent ) { if ( this . outgoingConnections . size ( ) == 1 ) { if ( this . openBranches == null || this . openBranches . isEmpty ( ) ) { return Collections . emptyList ( ) ; } else { return new ArrayList < UnclosedBranchDescriptor > ( this . openBranches ) ; } } else if ( this . outgoingConnections . size ( ) > 1 ) { List < UnclosedBranchDescriptor > branches = new ArrayList < UnclosedBranchDescriptor > ( 4 ) ; if ( this . openBranches != null ) { branches . addAll ( this . openBranches ) ; } int num ; for ( num = 0 ; num < this . outgoingConnections . size ( ) ; num ++ ) { if ( this . outgoingConnections . get ( num ) == toParent ) { break ; } } if ( num >= this . outgoingConnections . size ( ) ) { throw new CompilerException ( "Error in compiler: " + "Parent to get branch info for is not contained in the outgoing connections." ) ; } long bitvector = 0x1L << num ; branches . add ( new UnclosedBranchDescriptor ( this , bitvector ) ) ; return branches ; } else { throw new CompilerException ( "Error in compiler: Cannot get branch info for successor in a node with no successors." ) ; } }
@param toParent
@return