001// Copyright (c) FIRST and other WPILib contributors. 002// Open Source Software; you can modify and/or share it under the terms of 003// the WPILib BSD license file in the root directory of this project. 004 005// THIS FILE WAS AUTO-GENERATED BY ./ntcore/generate_topics.py. DO NOT MODIFY 006 007package edu.wpi.first.networktables; 008 009import edu.wpi.first.util.function.FloatSupplier; 010 011/** NetworkTables Float subscriber. */ 012public interface FloatSubscriber extends Subscriber, FloatSupplier { 013 /** 014 * Get the corresponding topic. 015 * 016 * @return Topic 017 */ 018 @Override 019 FloatTopic getTopic(); 020 021 /** 022 * Get the last published value. 023 * If no value has been published, returns the stored default value. 024 * 025 * @return value 026 */ 027 float get(); 028 029 /** 030 * Get the last published value. 031 * If no value has been published, returns the passed defaultValue. 032 * 033 * @param defaultValue default value to return if no value has been published 034 * @return value 035 */ 036 float get(float defaultValue); 037 038 @Override 039 default float getAsFloat() { 040 return get(); 041 } 042 043 /** 044 * Get the last published value along with its timestamp 045 * If no value has been published, returns the stored default value and a 046 * timestamp of 0. 047 * 048 * @return timestamped value 049 */ 050 TimestampedFloat getAtomic(); 051 052 /** 053 * Get the last published value along with its timestamp 054 * If no value has been published, returns the passed defaultValue and a 055 * timestamp of 0. 056 * 057 * @param defaultValue default value to return if no value has been published 058 * @return timestamped value 059 */ 060 TimestampedFloat getAtomic(float defaultValue); 061 062 /** 063 * Get an array of all value changes since the last call to readQueue. 064 * Also provides a timestamp for each value. 065 * 066 * <p>The "poll storage" subscribe option can be used to set the queue 067 * depth. 068 * 069 * @return Array of timestamped values; empty array if no new changes have 070 * been published since the previous call. 071 */ 072 TimestampedFloat[] readQueue(); 073 074 /** 075 * Get an array of all value changes since the last call to readQueue. 076 * 077 * <p>The "poll storage" subscribe option can be used to set the queue 078 * depth. 079 * 080 * @return Array of values; empty array if no new changes have been 081 * published since the previous call. 082 */ 083 float[] readQueueValues(); 084}