Package org.codehaus.janino
Class CodeContext.Offset
- java.lang.Object
-
- org.codehaus.janino.CodeContext.Offset
-
- Direct Known Subclasses:
CodeContext.FourByteOffset
,CodeContext.Inserter
,CodeContext.LineNumberOffset
- Enclosing class:
- CodeContext
public class CodeContext.Offset extends java.lang.Object
A class that represents an offset within a "Code" attribute.The concept of an "offset" is that if one writes into the middle of a "Code" attribute, all offsets behind the insertion point are automatically shifted.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) CodeContext.Offset
next
Links to preceding and succeeding offsets.(package private) int
offset
The offset in the code attribute that this object represents.(package private) CodeContext.Offset
prev
Links to preceding and succeeding offsets.private StackMap
stackMap
(package private) static int
UNSET
-
Constructor Summary
Constructors Constructor Description Offset()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CodeContext
getCodeContext()
StackMap
getStackMap()
void
set()
Sets this "Offset" to the offset of the current inserter; inserts this "Offset" before the current inserter.void
setOffset()
(package private) void
setStackMap()
Merges the stack maps of the current inserter and THIS offset, and assigns the result to the current inserter and THIS offset.void
setStackMap(StackMap stackMap)
java.lang.String
toString()
-
-
-
Field Detail
-
offset
int offset
The offset in the code attribute that this object represents.
-
prev
@Nullable CodeContext.Offset prev
-
next
@Nullable CodeContext.Offset next
-
UNSET
static final int UNSET
- See Also:
- Constant Field Values
-
-
Method Detail
-
set
public void set()
Sets this "Offset" to the offset of the current inserter; inserts this "Offset" before the current inserter.
-
setStackMap
void setStackMap()
Merges the stack maps of the current inserter and THIS offset, and assigns the result to the current inserter and THIS offset.
-
setOffset
public void setOffset()
-
getStackMap
public StackMap getStackMap()
-
setStackMap
public void setStackMap(StackMap stackMap)
-
getCodeContext
public final CodeContext getCodeContext()
- Returns:
- The
CodeContext
that thisCodeContext.Offset
belongs to
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-