Class ConstantPool
java.lang.Object
org.eclipse.m2m.atl.emftvm.impl.resource.ConstantPool
Constant pool implementation for binary EMFTVM file format.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassCreates constant pool entries for EMFTVM elements. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newConstantPool.ConstantPool(int size) Creates a newConstantPool. -
Method Summary
Modifier and TypeMethodDescriptionvoidAddsvoidcreateConstants(Module module) Creates a constant table for the given module.get(int i) Returns the constant at indexintReturns the index ofvoidread(DataInputStream in) Reads constant table fromintsize()Returns the size of the constant pool.voidwrite(DataOutputStream out) Writes constant pool to
-
Field Details
-
createConstants
-
-
Constructor Details
-
ConstantPool
public ConstantPool()Creates a newConstantPool. -
ConstantPool
public ConstantPool(int size) Creates a newConstantPool.- Parameters:
size- the initial pool size
-
-
Method Details
-
get
Returns the constant at indexi
.- Parameters:
i- the constant index- Returns:
- the constant, or
null
-
indexOf
Returns the index ofvalue
in the constant pool.- Parameters:
value- the value to look up- Returns:
- the index of value in the constant pool
- Throws:
IllegalArgumentException- if value not found
-
size
public int size()Returns the size of the constant pool.- Returns:
- The size of the constant pool
-
add
Addsvalue
to the constant pool, if necessary.- Parameters:
value- the value to add
-
read
Reads constant table fromin
.- Parameters:
in- the input stream- Throws:
IOException
-
createConstants
Creates a constant table for the given module.- Parameters:
module- the module
-
write
Writes constant pool toout
.- Parameters:
out- the output stream- Throws:
IOException
-