All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.rcsb.cif.model.text.TextBlock Maven / Gradle / Ivy

package org.rcsb.cif.model.text;

import org.rcsb.cif.model.Block;
import org.rcsb.cif.model.Category;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class TextBlock implements Block {
    private final Map categories;
    private final List saveFrames;
    private final String header;

    public TextBlock(Map categories, String header, List saveFrames) {
        this.categories = categories;
        this.saveFrames = saveFrames;
        this.header = header;
    }

    public TextBlock(Map categories, String header) {
        this(categories, header, new ArrayList<>());
    }

    @Override
    public String getBlockHeader() {
        return header;
    }

    @Override
    public Category getCategory(String name) {
        return categories.computeIfAbsent(name, Category.EmptyCategory::new);
    }

    @Override
    public Map getCategories() {
        return categories;
    }

    @Override
    public List getSaveFrames() {
        return saveFrames;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy