|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.carbonfive.flash.LoopFinder
public class LoopFinder
LoopFinder detects infinite loops during translation to Action Script. Specific encoders notify the loop finder
when they are recursing down an object hierarchy, and when they are coming out of that recursion. At a specific
maximum depth (250), an InfiniteLoopException
is thrown.
This class also keeps a buffer of the last 20 classes encoded, as well as a list of "possibles". The list of
possibles is a collection of classes that appear in a specific pattern with themselves during the translation.
For example, if during translation a Player
object appears two encodings away from another
Player
object 50 times or more, it is listed as a "possible".
When an InfiniteLoopException
is generated, both the buffer of recently encoded classes and the list
of possibles is given to it. Both of these are output when InfiniteLoopException.getMessage()
is called.
Constructor Summary | |
---|---|
LoopFinder()
|
Method Summary | |
---|---|
void |
add(java.lang.Class klass)
Notify LoopFinder that a specific class is being encoded. |
org.apache.commons.collections.SequencedHashMap |
getBuffer()
Get the buffer of the last 20 classes encoded, as described in the class JavaDoc above. |
int |
getDepth()
Get the current depth. |
java.util.Map |
getPossibles()
Get the list of "possibles", as described in the class JavaDoc above. |
boolean |
isLoop()
Indicates whether an infinite loop has been found or not. |
void |
stepIn()
Descend one level of recursion. |
void |
stepOut()
Ascend one level out of recursion. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LoopFinder()
Method Detail |
---|
public void add(java.lang.Class klass)
klass
- The class being encodedpublic boolean isLoop()
public java.util.Map getPossibles()
public org.apache.commons.collections.SequencedHashMap getBuffer()
public int getDepth()
public void stepIn()
public void stepOut()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |