1 11 package org.eclipse.jdt.internal.corext.fix; 12 13 import java.util.ArrayList ; 14 import java.util.List ; 15 16 import org.eclipse.jdt.core.dom.rewrite.ITrackedNodePosition; 17 18 public class PositionGroup { 19 20 private final String fGroupId; 21 private final List fPositions; 22 private final List fProposals; 23 private final List fDisplayStrings; 24 private ITrackedNodePosition fFirstPosition; 25 26 public ITrackedNodePosition getFirstPosition() { 27 return fFirstPosition; 28 } 29 30 public PositionGroup(String groupID) { 31 fGroupId= groupID; 32 fPositions= new ArrayList (); 33 fProposals= new ArrayList (); 34 fDisplayStrings= new ArrayList (); 35 } 36 37 public void addPosition(ITrackedNodePosition position) { 38 fPositions.add(position); 39 } 40 41 public void addFirstPosition(ITrackedNodePosition position) { 42 addPosition(position); 43 fFirstPosition= position; 44 } 45 46 public void addProposal(String displayString, String proposal) { 47 fProposals.add(proposal); 48 fDisplayStrings.add(displayString); 49 } 50 51 public String getGroupId() { 52 return fGroupId; 53 } 54 55 public ITrackedNodePosition[] getPositions() { 56 return (ITrackedNodePosition[])fPositions.toArray(new ITrackedNodePosition[fPositions.size()]); 57 } 58 59 public String [] getDisplayStrings() { 60 return (String [])fDisplayStrings.toArray(new String [fDisplayStrings.size()]); 61 } 62 63 public String [] getProposals() { 64 return (String [])fProposals.toArray(new String [fProposals.size()]); 65 } 66 } 67 | Popular Tags |