1
package org.herac.tuxguitar.io.ptb.base;
3
import java.util.ArrayList;
4
import java.util.Iterator;
7
public class PTSection {
11
private List positions;
13
public PTSection(int number){
15
this.positions = new ArrayList();
18
public int getNumber(){
22
public int getStaffs() {
26
public void setStaffs(int staffs) {
30
public List getPositions(){
31
return this.positions;
34
public PTPosition getPosition(int position){
35
Iterator it = getPositions().iterator();
37
PTPosition p = (PTPosition)it.next();
38
if(p.getPosition() == position){
42
PTPosition p = new PTPosition(position);
43
getPositions().add(p);
47
public int getNextPositionNumber(){
49
Iterator it = getPositions().iterator();
51
PTPosition p = (PTPosition)it.next();
52
next = Math.max(next, (p.getPosition() + 1) );
58
int count = getPositions().size();
59
for(int i = 0;i < count;i++){
60
PTPosition minimun = null;
61
for(int j = i;j < count;j++){
62
PTPosition position = (PTPosition)getPositions().get(j);
63
if(minimun == null || position.getPosition() < minimun.getPosition()){
67
getPositions().remove(minimun);
68
getPositions().add(i,minimun);