GraphTargetVisitorInterface for visiting model

This commit is contained in:
Jindra Petřík
2021-01-09 13:00:30 +01:00
parent 4926cb04d0
commit 819a739397
94 changed files with 791 additions and 251 deletions

View File

@@ -12,7 +12,8 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
* License along with this library.
*/
package com.jpexs.decompiler.graph;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
@@ -42,6 +43,7 @@ import com.jpexs.decompiler.graph.model.NotItem;
import com.jpexs.decompiler.graph.model.TrueItem;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -498,12 +500,21 @@ public abstract class GraphTargetItem implements Serializable, Cloneable {
public List<GraphTargetItem> getAllSubItems() {
List<GraphTargetItem> ret = new ArrayList<>();
List<GraphTargetItem> ret = new ArrayList<>();
if (value != null) {
ret.add(value);
visit(new AbstractGraphTargetVisitor() {
@Override
public void visit(GraphTargetItem item) {
ret.add(item);
}
});
return ret;
}
public void visit(GraphTargetVisitorInterface visitor) {
if (value != null) {
visitor.visit(value);
}
}
public abstract GraphTargetItem returnType();
@Override