Package org.apache.sysds.runtime.controlprogram

# Class LocalVariableMap

java.lang.Object
org.apache.sysds.runtime.controlprogram.LocalVariableMap

All Implemented Interfaces:
  `Cloneable`

public class LocalVariableMap extends Object implements Cloneable
Replaces `HashMap⟨String, Data⟩` as the table of variable names and references. No longer supports global consistency.

## Constructor Summary

Constructors
Constructor
Description
`LocalVariableMap()`
`LocalVariableMap(LocalVariableMap vars)`

## Method Summary

Modifier and Type
Method
Description
`Object`
`clone()`
`static LocalVariableMap`
`deserialize(String varStr)`
`Set<Map.Entry<String,Data>>`
`entrySet()`
`Data`
`get(String name)`
Retrieves the data object given its name.
`double`
`getPinnedDataSize()`
`HashSet<String>`
`getRegisteredOutputs()`
`boolean`
`hasReferences(Data d)`
`Set<String>`
`keySet()`
`void`
`put(String name, Data val)`
Adds a new (name, value) pair to the variable map, or replaces an old pair with the same name.
`void`
`putAll(Map<String,Data> vals)`
`void`
`putAll(LocalVariableMap vars)`
`void`
`releaseAcquiredData()`
`Data`
`remove(String name)`
`void`
`removeAll()`
`void`
`removeAllIn(Set<String> excludeList)`
`void`
`removeAllNotIn(Set<String> excludeList)`
`String`
`serialize()`
`void`
`setID(long ID)`
`void`
`setRegisteredOutputs(HashSet<String> outputs)`
`String`
`toString()`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### LocalVariableMap

public LocalVariableMap()

### LocalVariableMap

public LocalVariableMap(LocalVariableMap vars)

## Method Details

### setID

public void setID(long ID)

### keySet

public Set<String> keySet()

### entrySet

public Set<Map.Entry<String,Data>> entrySet()

### get

public Data get(String name)
Retrieves the data object given its name.

Parameters:
  `name` - the variable name for the data object
Returns:
  the direct reference to the data object

### put

public void put(String name, Data val)
Adds a new (name, value) pair to the variable map, or replaces an old pair with the same name. Several different variable names may refer to the same value.

Parameters:
  `name` - the variable name for the data value
  `val` - the data value object (such as envelope)

### putAll

public void putAll(Map<String,Data> vals)

### putAll

public void putAll(LocalVariableMap vars)

### remove

public Data remove(String name)

### removeAll

public void removeAll()

### removeAllIn

public void removeAllIn(Set<String> excludeList)

### removeAllNotIn

public void removeAllNotIn(Set<String> excludeList)

### hasReferences

public boolean hasReferences(Data d)

### setRegisteredOutputs

public void setRegisteredOutputs(HashSet<String> outputs)

### getRegisteredOutputs

public HashSet<String> getRegisteredOutputs()

### getPinnedDataSize

public double getPinnedDataSize()

### releaseAcquiredData

public void releaseAcquiredData()

### serialize

public String serialize()

### deserialize

public static LocalVariableMap deserialize(String varStr)

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### clone

public Object clone()