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 005package edu.wpi.first.networktables; 006 007/** 008 * Flag values for use with entry listeners. 009 * 010 * <p>The flags are a bitmask and must be OR'ed together to indicate the combination of events 011 * desired to be received. 012 * 013 * <p>The constants kNew, kDelete, kUpdate, and kFlags represent different events that can occur to 014 * entries. 015 * 016 * <p>By default, notifications are only generated for remote changes occurring after the listener 017 * is created. The constants kImmediate and kLocal are modifiers that cause notifications to be 018 * generated at other times. 019 */ 020public interface EntryListenerFlags { 021 /** 022 * Initial listener addition. 023 * 024 * <p>Set this flag to receive immediate notification of entries matching the flag criteria 025 * (generally only useful when combined with kNew). 026 */ 027 int kImmediate = 0x01; 028 029 /** 030 * Changed locally. 031 * 032 * <p>Set this flag to receive notification of both local changes and changes coming from remote 033 * nodes. By default, notifications are only generated for remote changes. Must be combined with 034 * some combination of kNew, kDelete, kUpdate, and kFlags to receive notifications of those 035 * respective events. 036 */ 037 int kLocal = 0x02; 038 039 /** 040 * Newly created entry. 041 * 042 * <p>Set this flag to receive a notification when an entry is created. 043 */ 044 int kNew = 0x04; 045 046 /** 047 * Entry was deleted. 048 * 049 * <p>Set this flag to receive a notification when an entry is deleted. 050 */ 051 int kDelete = 0x08; 052 053 /** 054 * Entry's value changed. 055 * 056 * <p>Set this flag to receive a notification when an entry's value (or type) changes. 057 */ 058 int kUpdate = 0x10; 059 060 /** 061 * Entry's flags changed. 062 * 063 * <p>Set this flag to receive a notification when an entry's flags value changes. 064 */ 065 int kFlags = 0x20; 066}