Interface Column<T>

Type Parameters:
T - the array type of this column (int[], double[], String[])
All Known Subinterfaces:
FloatColumn, IntColumn, StrColumn
All Known Implementing Classes:
BinaryColumn, BinaryFloatColumn, BinaryIntColumn, BinaryStrColumn, Column.EmptyColumn, DelegatingColumn, DelegatingFloatColumn, DelegatingIntColumn, DelegatingStrColumn, TextColumn

public interface Column<T>
Represents a column of information in a CifFile, e.g. the coordinates in x-dimension of all atoms.
  • Method Details

    • getColumnName

      String getColumnName()
      The name of this Column.
      Returns:
      the String which is used to acquire this column from its parent Category
    • getRowCount

      int getRowCount()
      The number of rows in this Column. 0 indicates undefined a Column.
      Returns:
      the length of this Column
    • getStringData

      String getStringData​(int row)
      Access to entries of this Column without any assumptions about the content type. No checks about the validity of the row argument are made. Values smaller than 0 or larger or equal to the row count will raise exceptions.
      Parameters:
      row - index of the element to retrieve
      Returns:
      the String representation of the corresponding row
    • stringData

      default Stream<String> stringData()
      Access to all entries of this column as String values.
      Returns:
      a Stream of all String values
    • getValueKind

      ValueKind getValueKind​(int row)
      States the ValueKind for a particular row. Elements may either be 'present', 'not_specified' (.) or 'unknown' (?).
      Parameters:
      row - index of the element for which the ValueKind should be retrieved
      Returns:
      the corresponding ValueKind enum entry
    • valueKinds

      default Stream<ValueKind> valueKinds()
      Stream of all ValueKind annotations.
      Returns:
      a Stream with a number of ValueKinds equal to row count
    • isDefined

      default boolean isDefined()
      Queries this column whether it is defined. To avoid NullPointerException being thrown left, right, and center, categories and columns not present in a parsed file will be presented by an undefined state.
      Returns:
      false if this Column has row count 0 and no data in it
    • getArray

      T getArray()
      Access to the underlying data array. Useful, when you are sure that your dealing with binary data and want the most efficient access to all data in this column. For text data, this will be 'slow' as it requires the creation of the requested array by parsing all data in this column.
      Returns:
      an array of the appropriate type (int[], double[], String[])