public abstract class DVMap
extends java.lang.Object
Allows to translate variable names into constants of Java primitive types at compile-time. See the section of the manual on dynamic variables.
Constructor and Description |
---|
DVMap() |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.String |
getTypeName(java.lang.String name)
Returns the name of the type of the named property.
|
java.lang.Object |
translate(java.lang.String name)
Translates the variable name (a String) to a constant of any primtive
type (e.g.
|
public abstract java.lang.String getTypeName(java.lang.String name)
The dot ('.') symbol can be present in the property name to denote hierarchical naming scheme.
If hierarchical naming scheme is used and the variable x.y is defined the variable x must also be defined.
name
- is the name of the property.public java.lang.Object translate(java.lang.String name)
The performance of the compiled code can be sometimes improved by letting it not to deal with strings. For example, in older JEL <=0.9.8 this method was absent, and, if the underlying representation of the dynamic variables storage was an array, the translation of variable name (represented by String) into integer index had to happen at run-time, taking up the valuable processor cycles. Defining the proper DVMap.translate one can perform the translation "variable name(String)"->"slot number(int)" at compile time. There can be also other clever ways of using translation to improve performance even if variables are not stored in an array or vector.
The default implementation provides the identity translation, which simulates the behaviour of older versions of JEL.
name
- Name of the variable to be translated.Copyright © 1998-2016 Konstantin L. Metlov All Rights Reserved.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the JEL manual.