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

oshi.hardware.common.AbstractPowerSource Maven / Gradle / Ivy

package oshi.hardware.common;

import oshi.hardware.PowerSource;

/**
 * @author angju
 * 
 */
public abstract class AbstractPowerSource implements PowerSource {

    private static final long serialVersionUID = 1L;

    protected String name;

    protected double remainingCapacity;

    protected double timeRemaining;

    /**
     * Super constructor used by platform-specific implementations of
     * PowerSource
     *
     * @param newName
     *            The name to assign
     * @param newRemainingCapacity
     *            Fraction of remaining capacity
     * @param newTimeRemaining
     *            Seconds of time remaining
     */
    public AbstractPowerSource(String newName, double newRemainingCapacity, double newTimeRemaining) {
        this.name = newName;
        this.remainingCapacity = newRemainingCapacity;
        this.timeRemaining = newTimeRemaining;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getName() {
        return this.name;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public double getRemainingCapacity() {
        return this.remainingCapacity;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public double getTimeRemaining() {
        return this.timeRemaining;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy