Class ConstantPool
- java.lang.Object
-
- org.eclipse.m2m.atl.emftvm.impl.resource.ConstantPool
-
public class ConstantPool extends java.lang.ObjectConstant pool implementation for binary EMFTVM file format.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classConstantPool.CreateConstantsSwitchCreates constant pool entries for EMFTVM elements.
-
Field Summary
Fields Modifier and Type Field Description protected ConstantPool.CreateConstantsSwitchcreateConstants
-
Constructor Summary
Constructors Constructor Description ConstantPool()Creates a newConstantPool.ConstantPool(int size)Creates a newConstantPool.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.Object value)AddsvoidcreateConstants(Module module)Creates a constant table for the given module.java.lang.Objectget(int i)Returns the constant at indexintindexOf(java.lang.Object value)Returns the index ofvoidread(java.io.DataInputStream in)Reads constant table fromintsize()Returns the size of the constant pool.voidwrite(java.io.DataOutputStream out)Writes constant pool to
-
-
-
Field Detail
-
createConstants
protected ConstantPool.CreateConstantsSwitch createConstants
-
-
Constructor Detail
-
ConstantPool
public ConstantPool()
Creates a newConstantPool.
-
ConstantPool
public ConstantPool(int size)
Creates a newConstantPool.- Parameters:
size- the initial pool size
-
-
Method Detail
-
get
public java.lang.Object get(int i)
Returns the constant at indexi
.- Parameters:
i- the constant index- Returns:
- the constant, or
null
-
indexOf
public int indexOf(java.lang.Object value) throws java.lang.IllegalArgumentExceptionReturns the index ofvalue
in the constant pool.- Parameters:
value- the value to look up- Returns:
- the index of value in the constant pool
- Throws:
java.lang.IllegalArgumentException- if value not found
-
size
public int size()
Returns the size of the constant pool.- Returns:
- The size of the constant pool
-
add
public void add(java.lang.Object value)
Addsvalue
to the constant pool, if necessary.- Parameters:
value- the value to add
-
read
public void read(java.io.DataInputStream in) throws java.io.IOExceptionReads constant table fromin
.- Parameters:
in- the input stream- Throws:
java.io.IOException
-
createConstants
public void createConstants(Module module)
Creates a constant table for the given module.- Parameters:
module- the module
-
write
public void write(java.io.DataOutputStream out) throws java.io.IOExceptionWrites constant pool toout
.- Parameters:
out- the output stream- Throws:
java.io.IOException
-
-