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 java.util.function.Supplier; 010 011/** NetworkTables DoubleArray subscriber. */ 012public interface DoubleArraySubscriber extends Subscriber, Supplier<double[]> { 013 /** 014 * Get the corresponding topic. 015 * 016 * @return Topic 017 */ 018 @Override 019 DoubleArrayTopic 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 double[] 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 double[] get(double[] defaultValue); 037 038 /** 039 * Get the last published value along with its timestamp 040 * If no value has been published, returns the stored default value and a 041 * timestamp of 0. 042 * 043 * @return timestamped value 044 */ 045 TimestampedDoubleArray getAtomic(); 046 047 /** 048 * Get the last published value along with its timestamp 049 * If no value has been published, returns the passed defaultValue and a 050 * timestamp of 0. 051 * 052 * @param defaultValue default value to return if no value has been published 053 * @return timestamped value 054 */ 055 TimestampedDoubleArray getAtomic(double[] defaultValue); 056 057 /** 058 * Get an array of all value changes since the last call to readQueue. 059 * Also provides a timestamp for each value. 060 * 061 * <p>The "poll storage" subscribe option can be used to set the queue 062 * depth. 063 * 064 * @return Array of timestamped values; empty array if no new changes have 065 * been published since the previous call. 066 */ 067 TimestampedDoubleArray[] readQueue(); 068 069 /** 070 * Get an array of all value changes since the last call to readQueue. 071 * 072 * <p>The "poll storage" subscribe option can be used to set the queue 073 * depth. 074 * 075 * @return Array of values; empty array if no new changes have been 076 * published since the previous call. 077 */ 078 double[][] readQueueValues(); 079}