Package org.apache.sysds.runtime.instructions.cp

## Class ListObject

- java.lang.Object
- - org.apache.sysds.runtime.instructions.cp.Data
  - - org.apache.sysds.runtime.instructions.cp.ListObject

All Implemented Interfaces:
  `Externalizable`, `Serializable`

    public class ListObject
    extends Data
    implements Externalizable

See Also:
  Serialized Form

### Constructor Summary

Constructors
`ListObject()`
`ListObject​(List<Data> data)`
`ListObject​(List<Data> data, List<String> names)`
`ListObject​(List<Data> data, List<String> names, List<LineageItem> lineage)`
`ListObject​(Data[] data)`
`ListObject​(Data[] data, String[] names)`
`ListObject​(ListObject that)`

### Method Summary

All Methods Instance Methods Concrete Methods
`ListObject` `add​(String name, Data dat, LineageItem li)`
`ListObject` `add​(Data dat, LineageItem li)`
`boolean` `checkAllDataTypes​(Types.DataType dt)`
`boolean` `contains​(String name)`
`boolean` `contains​(Data d)`
`ListObject` `copy()`
`void` `deriveAndSetStatusFromData()`
`void` `enableCleanup​(boolean flag)` Sets the cleanupFlag values recursively for every element of type CacheableData in the list and in its sublists to the provided flag value.
`void` `enableCleanup​(Queue<Boolean> flags)` Sets the cleanupFlag values recursively for every element of type CacheableData in the list and in its sublists to the provided values in flags.
`List<Boolean>` `getCleanupStates()` Gets list of current cleanupFlag values recursively for every element in the list and in its sublists of type CacheableData.
`List<Data>` `getData()`
`Data` `getData​(int ix)`
`Data` `getData​(String name)`
`long` `getDataSize()`
`String` `getDebugName()`
`int` `getLength()`
`LineageItem` `getLineageItem​(int ix)`
`LineageItem` `getLineageItem​(String name)`
`List<LineageItem>` `getLineageItems()`
`String` `getName​(int ix)`
`List<String>` `getNames()`
`int` `getNumCacheableData()`
`boolean[]` `getStatus()`
`boolean` `isNamedList()`
`void` `readExternal​(ObjectInput in)` Redirects the default java serialization via externalizable to our default hadoop writable serialization for efficient broadcast/rdd deserialization.
`ListObject` `remove​(int pos)` Removes the element at the specified position from the list and returns that element as the only element in a new ListObject.
`ListObject` `set​(int ix1, int ix2, ListObject data)`
`ListObject` `set​(int ix, Data data)`
`ListObject` `set​(int ix, Data data, LineageItem li)`
`ListObject` `set​(String name1, String name2, ListObject data)`
`Data` `set​(String name, Data data)`
`Data` `set​(String name, Data data, LineageItem li)`
`void` `setNames​(List<String> names)`
`void` `setStatus​(boolean[] status)`
`Data` `slice​(int ix)`
`ListObject` `slice​(int ix1, int ix2)`
`Data` `slice​(String name)`
`ListObject` `slice​(String name1, String name2)`
`String` `toString()`
`void` `writeExternal​(ObjectOutput out)` Redirects the default java serialization via externalizable to our default hadoop writable serialization for efficient broadcast/rdd serialization.

### Methods inherited from class org.apache.sysds.runtime.instructions.cp.Data

`getDataType, getMetaData, getPrivacyConstraint, getValueType, removeMetaData, setMetaData, setPrivacyConstraints, updateDataCharacteristics`

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

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

### Constructor Detail

#### ListObject

    public ListObject()

#### ListObject

    public ListObject​(List<Data> data)

#### ListObject

    public ListObject​(Data[] data)

#### ListObject

    public ListObject​(List<Data> data,
                      List<String> names)

#### ListObject

    public ListObject​(Data[] data,
                      String[] names)

#### ListObject

    public ListObject​(List<Data> data,
                      List<String> names,
                      List<LineageItem> lineage)

#### ListObject

    public ListObject​(ListObject that)

### Method Detail

#### deriveAndSetStatusFromData

    public void deriveAndSetStatusFromData()

#### setStatus

    public void setStatus​(boolean[] status)

#### getStatus

    public boolean[] getStatus()

#### getLength

    public int getLength()

#### getNumCacheableData

    public int getNumCacheableData()

#### getNames

    public List<String> getNames()

#### setNames

    public void setNames​(List<String> names)

#### getName

    public String getName​(int ix)

#### isNamedList

    public boolean isNamedList()

#### getData

    public List<Data> getData()

#### getData

    public Data getData​(int ix)

#### getData

    public Data getData​(String name)

#### getLineageItem

    public LineageItem getLineageItem​(String name)

#### getLineageItems

    public List<LineageItem> getLineageItems()

#### contains

    public boolean contains​(Data d)

#### contains

    public boolean contains​(String name)

#### getDataSize

    public long getDataSize()

#### checkAllDataTypes

    public boolean checkAllDataTypes​(Types.DataType dt)

#### slice

    public Data slice​(int ix)

#### getLineageItem

    public LineageItem getLineageItem​(int ix)

#### slice

    public ListObject slice​(int ix1,
                            int ix2)

#### slice

    public Data slice​(String name)

#### slice

    public ListObject slice​(String name1,
                            String name2)

#### copy

    public ListObject copy()

#### set

    public ListObject set​(int ix,
                          Data data)

#### set

    public ListObject set​(int ix,
                          Data data,
                          LineageItem li)

#### set

    public ListObject set​(int ix1,
                          int ix2,
                          ListObject data)

#### set

    public Data set​(String name,
                    Data data)

#### set

    public Data set​(String name,
                    Data data,
                    LineageItem li)

#### set

    public ListObject set​(String name1,
                          String name2,
                          ListObject data)

#### add

    public ListObject add​(Data dat,
                          LineageItem li)

#### add

    public ListObject add​(String name,
                          Data dat,
                          LineageItem li)

#### remove

    public ListObject remove​(int pos)

Removes the element at the specified position from the list and returns that element as the only element in a new ListObject.

Parameters:
  `pos` - position of element in the list
Returns:
  new ListObject with the specified element

#### getDebugName

    public String getDebugName()

Specified by:
  `getDebugName` in class `Data`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### writeExternal

    public void writeExternal​(ObjectOutput out)
                       throws IOException

Redirects the default java serialization via externalizable to our default hadoop writable serialization for efficient broadcast/rdd serialization.

Specified by:
  `writeExternal` in interface `Externalizable`
Parameters:
  `out` - object output
Throws:
  `IOException` - if IOException occurs

#### readExternal

    public void readExternal​(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Redirects the default java serialization via externalizable to our default hadoop writable serialization for efficient broadcast/rdd deserialization.

Specified by:
  `readExternal` in interface `Externalizable`
Parameters:
  `in` - object input
Throws:
  `IOException` - if IOException occurs
  `ClassNotFoundException`

#### getCleanupStates

    public List<Boolean> getCleanupStates()

Gets list of current cleanupFlag values recursively for every element in the list and in its sublists of type CacheableData. The order is as CacheableData elements are discovered during DFS. Elements that are not of type CacheableData are skipped.

Returns:
  list of booleans containing the _cleanupFlag values.

#### enableCleanup

    public void enableCleanup​(boolean flag)

Sets the cleanupFlag values recursively for every element of type CacheableData in the list and in its sublists to the provided flag value.

Parameters:
  `flag` - New value for every CacheableData element.

#### enableCleanup

    public void enableCleanup​(Queue<Boolean> flags)

Sets the cleanupFlag values recursively for every element of type CacheableData in the list and in its sublists to the provided values in flags. The cleanupFlag value of the i-th CacheableData element in the list (counted in the order of DFS) is set to the i-th value in flags.

Parameters:
  `flags` - Queue of values in the same order as its corresponding elements occur in DFS.