Interface Block

All Known Implementing Classes:
BinaryBlock, CifCoreBlock, DelegatingBlock, MmCifBlock, TextBlock

public interface Block
Represents a Block in a CifFile.
  • Method Details

    • getBlockHeader

      String getBlockHeader()
      The header of this Block.
      Returns:
      String of the header
    • getCategory

      Category getCategory​(String name)
      Retrieve a particular Category by name.
      Parameters:
      name - the category name
      Returns:
      the corresponding Category, if none exists a instance of Category is returned as proxy
    • getColumn

      default Column<?> getColumn​(String name)
      Retrieve a Column by name. This is relevant for CCDC files that identify columns by 'flat' names such as "cell_length_a"
      Parameters:
      name - the category name and column name, joined by an underscore
      Returns:
      the corresponding Column, if none exists a instance of Column is returned as proxy
    • getCategories

      Map<String,​Category> getCategories()
      Access to the category map wrapped by this block.
      Returns:
      a map with category names as keys and instances as values
    • categories

      default Stream<Category> categories()
      Traverses all present categories.
      Returns:
      a Stream of all Category instances
    • getSaveFrames

      List<Block> getSaveFrames()
      All save frames associated to this Block.
      Returns:
      collection of save frames
    • saveFrames

      default Stream<Block> saveFrames()
      Convenience method to traverse all save frames.
      Returns:
      a Stream of all save frames.
    • getCategory

      default <C extends Category> C getCategory​(String name, Function<Category,​C> wrapper)
      'Type-safe' access to arbitrary categories.
      Type Parameters:
      C - the desired type
      Parameters:
      name - the category name to retrieve
      wrapper - a mapping function that ensures that correct behavior of this category
      Returns:
      typed instance of the requested category