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 and Description
`LocalVariableMap()`
`LocalVariableMap(LocalVariableMap vars)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`Object` `clone()`
`long` `countPinnedData()`
`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(LocalVariableMap vars)`
`void` `putAll(Map<String,Data> vals)`
`Data` `remove(String name)`
`void` `removeAll()`
`void` `removeAllIn(Set<String> excludeList)`
`void` `removeAllNotIn(Set<String> excludeList)`
`String` `serialize()`
`void` `setRegisteredOutputs(HashSet<String> outputs)`
`String` `toString()`

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

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

### Constructor Detail

#### LocalVariableMap

    public LocalVariableMap()

#### LocalVariableMap

    public LocalVariableMap(LocalVariableMap vars)

### Method Detail

#### 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()

#### countPinnedData

    public long countPinnedData()

#### serialize

    public String serialize()

#### deserialize

    public static LocalVariableMap deserialize(String varStr)

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### clone

    public Object clone()

Overrides:
  `clone` in class `Object`