|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.javascript.jscomp.VariableMap
public class VariableMap
Stores the mapping from original variable name to new variable names.
RenameVars
Method Summary | |
---|---|
static VariableMap |
fromBytes(byte[] bytes)
Deserializes the variable map from a byte array returned by toBytes() . |
static VariableMap |
fromMap(Map<String,String> map)
Initializes the variable map from an existing map. |
Map<String,String> |
getNewNameToOriginalNameMap()
Returns an unmodifiable mapping from new names to original names. |
Map<String,String> |
getOriginalNameToNewNameMap()
Returns an unmodifiable mapping from original names to new names. |
static VariableMap |
load(String filename)
Reads the variable map from a file written via save(String) . |
String |
lookupNewName(String sourceName)
Given an original variable name, look up new name, may return null if it's not found. |
String |
lookupSourceName(String newName)
Given a new variable name, lookup the source name, may return null if it's not found. |
void |
save(String filename)
Saves the variable map to a file. |
byte[] |
toBytes()
Serializes the variable map to a byte array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public String lookupNewName(String sourceName)
public String lookupSourceName(String newName)
public Map<String,String> getOriginalNameToNewNameMap()
public Map<String,String> getNewNameToOriginalNameMap()
public void save(String filename) throws IOException
IOException
public static VariableMap load(String filename) throws IOException
save(String)
.
IOException
public byte[] toBytes()
public static VariableMap fromBytes(byte[] bytes) throws ParseException
toBytes()
.
ParseException
public static VariableMap fromMap(Map<String,String> map)
map
- The map to use from original names to generated names. It is
copied and changes to the specified map will not affect the returned
object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |