mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 03:40:47 +00:00
Code formatting
This commit is contained in:
@@ -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>());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user