Code formatting

This commit is contained in:
Jindra Pet��k
2012-12-25 11:33:41 +01:00
parent 24a6b82a94
commit 14ae8e435c
643 changed files with 26017 additions and 27040 deletions
@@ -14,7 +14,6 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.jpexs.asdec.abc.avm2.flowgraph;
import java.util.ArrayList;
@@ -25,47 +24,48 @@ import java.util.List;
* @author JPEXS
*/
public class GraphPart {
public int start=0;
public int end=0;
public int instanceCount=0;
public List<GraphPart> nextParts=new ArrayList<GraphPart>();
public int posX=-1;
public int posY=-1;
public int start = 0;
public int end = 0;
public int instanceCount = 0;
public List<GraphPart> nextParts = new ArrayList<GraphPart>();
public int posX = -1;
public int posY = -1;
public GraphPart(int start, int end) {
this.start = start;
this.end = end;
}
public GraphPart(int start,int end) {
this.start=start;
this.end=end;
}
@Override
public String toString() {
if (end < start) {
return "<->";
}
return "" + (start + 1) + "-" + (end + 1) + (instanceCount > 1 ? "(" + instanceCount + " links)" : "");
}
@Override
public String toString() {
if(end<start){
return "<->";
}
return ""+(start+1)+"-"+(end+1)+(instanceCount>1?"("+instanceCount+" links)":"");
}
public boolean containsIP(int ip) {
return (ip >= start) && (ip <= end);
}
private boolean containsPart(GraphPart part, GraphPart what, List<GraphPart> used) {
if (used.contains(part)) {
return false;
}
used.add(part);
for (GraphPart subpart : part.nextParts) {
if (subpart == what) {
return true;
}
if (containsPart(subpart, what, used)) {
return true;
}
}
return false;
}
public boolean containsIP(int ip){
return (ip>=start)&&(ip<=end);
}
private boolean containsPart(GraphPart part,GraphPart what,List<GraphPart> used){
if(used.contains(part)) return false;
used.add(part);
for(GraphPart subpart:part.nextParts){
if(subpart==what) return true;
if(containsPart(subpart,what,used)) return true;
}
return false;
}
public boolean containsPart(GraphPart what){
return containsPart(this,what,new ArrayList<GraphPart>());
}
public boolean containsPart(GraphPart what) {
return containsPart(this, what, new ArrayList<GraphPart>());
}
}