private void move(int offset) { final List<ResultParticipation> orderedParticipations = this.getResult() .getResultParticipations(); final int newOrder = this.getPersonOrder() + offset;
private void move(OrderChange change) { final int newOrder = this.getPersonOrder() + OrderChange.getOffset(change); final List<ResultParticipation> originalList = this.getResult().getOrderedResultParticipations(); List<ResultParticipation> orderedParticipations = new ArrayList<ResultParticipation>(); orderedParticipations.addAll(originalList);
    private void move(int offset) {	final List<ResultParticipation> orderedParticipations = this.getResult()		.getResultParticipations();	final int newOrder = this.getPersonOrder() + offset;	orderedParticipations.remove(this);	// Participation will be the first element in list.	if (newOrder < 0) {	    orderedParticipations.add(0, this);	}	// Participation will be the last element in list.	else if (newOrder > orderedParticipations.size()) {	    orderedParticipations.add(orderedParticipations.size(), this);	}	// Participation will be on the newOrder in list.	else {	    orderedParticipations.add(newOrder, this);	}	// ResultParticipation list was re-arranged. Update personOrder slot	// (0,1,2...).	int index = 0;	for (ResultParticipation participation : orderedParticipations) {	    participation.setPersonOrderAttribute(index++);	}    }