com.groupdocs.assembly.system.data

Class DataRowCollection

  • java.lang.Object
    • com.groupdocs.assembly.system.data.DataRowCollection
  • All Implemented Interfaces:
    java.lang.Iterable


    public class DataRowCollection
    extends java.lang.Object
    implements java.lang.Iterable
    Represents a collection of rows for a DataTable.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void add(DataRow row)
      Adds the specified DataRow to the DataRowCollection object.
      void add(java.lang.Object... values)
      Creates a row using specified values and adds it to the DataRowCollection.
      void clear()
      Clears the collection of all rows.
      DataRow find(java.lang.Object[] keys)
      Gets the row that contains the specified primary key values.
      DataRow find(java.lang.String primaryKeyValue)
      Gets the row specified by the primary key value.
      DataRow get(int index)
      Gets the row at the specified index.
      DataRow get(java.lang.Object[] values)
      Gets the row that contains the specified values.
      int getCount()
      Gets the total number of DataRow objects in this collection.
      void insertAt(DataRow row, int pos)
      Inserts a new row into the collection at the specified location.
      java.util.Iterator iterator()
      Gets an Iterator for this collection.
      void removeAt(int index)
      Removes the row at the specified index from the collection.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Method Detail

      • get

        public DataRow get(int index)
        Gets the row at the specified index.
        Parameters:
        index - The zero-based index of the row to return.
        Returns:
        The specified DataRow.
      • getCount

        public int getCount()
        Gets the total number of DataRow objects in this collection.
        Returns:
        The total number of DataRow objects in this collection.
      • iterator

        public java.util.Iterator iterator()
        Gets an Iterator for this collection.
        Specified by:
        iterator in interface java.lang.Iterable
        Returns:
        An Iterator for this collection.
      • clear

        public void clear()
        Clears the collection of all rows.
      • removeAt

        public void removeAt(int index)
        Removes the row at the specified index from the collection.
        Parameters:
        index - The index of the row to remove.
      • find

        public DataRow find(java.lang.String primaryKeyValue)
        Gets the row specified by the primary key value.
        Parameters:
        primaryKeyValue - The primary key value of the DataRow to find.
        Returns:
        A DataRow that contains the primary key value specified; otherwise a null value if the primary key value does not exist in the DataRowCollection.
      • find

        public DataRow find(java.lang.Object[] keys)
        Gets the row that contains the specified primary key values.
        Parameters:
        keys - An array of primary key values to find. The type of the array is Object.
        Returns:
        A DataRow object that contains the primary key values specified; otherwise a null value if the primary key value does not exist in the DataRowCollection.
      • get

        public DataRow get(java.lang.Object[] values)
        Gets the row that contains the specified values. If there is primary key's column(s) present then the index will be used. If there is no index then simple linear scan is used. Be carefully with that because it could take a significant amount of time.
        Parameters:
        values - row's data
        Returns:
        found row or null