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

com.powsybl.dataframe.SeriesMapper Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (c) 2021, RTE (http://www.rte-france.com)
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 * SPDX-License-Identifier: MPL-2.0
 */
package com.powsybl.dataframe;

import java.util.List;

/**
 * Defines a mapping between objects and a series view.
 * It defines a name for the series, a way to retrieve data from the underlying objects
 * as a series, and a way to write data to the objects from a series input.
 *
 * @author Sylvain Leclerc {@literal }
 */
public interface SeriesMapper {

    SeriesMetadata getMetadata();

    void createSeries(List items, DataframeHandler factory, C context);

    default void updateInt(T object, int value) {
        throw new UnsupportedOperationException("Cannot update series with int: " + getMetadata().getName());
    }

    default void updateDouble(T object, double value, C context) {
        throw new UnsupportedOperationException("Cannot update series with double: " + getMetadata().getName());
    }

    default void updateString(T object, String value) {
        throw new UnsupportedOperationException("Cannot update series with string: " + getMetadata().getName());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy