<commit_before>/*
 *    Debrief - the Open Source Maritime Analysis Application
 *    http://debrief.info
 *
 *    (C) 2000-2014, PlanetMayo Ltd
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the Eclipse Public License v1.0
 *    (http://www.eclipse.org/legal/epl-v10.html)
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
 */
package MWC.GenericData;

// Copyright MWC 1999, Debrief 3 Project
// $RCSfile: WatchableList.java,v $
// @author $Author: Ian.Mayo $
// @version $Revision: 1.2 $
// $Log: WatchableList.java,v $
// Revision 1.2  2004/11/25 10:24:42  Ian.Mayo
// Switch to Hi Res dates
//
// Revision 1.1.1.2  2003/07/21 14:49:10  Ian.Mayo
// Re-import Java files to keep correct line spacing
//
// Revision 1.10  2003-05-08 16:00:57+01  ian_mayo
// remove unused imports
//
// Revision 1.9  2003-03-27 11:16:04+00  ian_mayo
// Update javadoc
//
// Revision 1.8  2003-03-19 15:37:21+00  ian_mayo
// improvements according to IntelliJ inspector
//
// Revision 1.7  2003-02-03 14:10:34+00  ian_mayo
// Add testing helper class
//
// Revision 1.6  2003-01-15 15:28:43+00  ian_mayo
// Improve comment
//
// Revision 1.5  2003-01-10 15:22:36+00  ian_mayo
// Add getVisible parameter
//
// Revision 1.4  2002-12-16 15:10:23+00  ian_mayo
// minor tidying
//
// Revision 1.3  2002-05-28 09:25:11+01  ian_mayo
// after switch to new system
//
// Revision 1.1  2002-05-28 09:11:44+01  ian_mayo
// Initial revision
//
// Revision 1.2  2002-05-08 14:40:50+01  ian_mayo
// make final objects static
//
// Revision 1.1  2002-04-23 12:28:40+01  ian_mayo
// Initial revision
//
// Revision 1.4  2002-03-13 08:46:49+00  administrator
// more comment improvements
//
// Revision 1.3  2002-03-13 08:40:33+00  administrator
// improve comments
//
// Revision 1.2  2001-10-01 12:49:53+01  administrator
// the getNearest method of WatchableList now returns an array of points (since a contact wrapper may contain several points at the same DTG).  We have had to reflect this across the application
//
// Revision 1.1  2001-08-06 16:57:43+01  administrator
// Add text field to use to categories the PropertyEvent when a watchable has been filtered
//
// Revision 1.0  2001-07-17 08:41:14+01  administrator
// Initial revision
//
// Revision 1.5  2001-01-15 11:19:01+00  novatech
// get the symbol to use for this list
//
// Revision 1.4  2001-01-11 15:37:11+00  novatech
// switch back to working with dates in long class format
//
// Revision 1.3  2001-01-11 11:53:02+00  novatech
// Before we switch from long dates to java.util.date dates.
//
// Revision 1.2  2001-01-09 10:28:40+00  novatech
// add extra parameters to allow WatchableLists to be used instead of TrackWrappers
//
// Revision 1.1  2001-01-03 13:40:27+00  novatech
// Initial revision
//
// Revision 1.1.1.1  2000/12/12 20:49:04  ianmayo
// initial import of files
//
// Revision 1.5  2000-10-16 11:50:46+01  ian_mayo
// changed default Time threshold for stepper
//
// Revision 1.4  2000-04-19 11:24:16+01  ian_mayo
// add time threshold parameter
//
// Revision 1.3  2000-04-03 10:20:25+01  ian_mayo
// add time-filtering method
//
// Revision 1.2  1999-10-15 12:37:16+01  ian_mayo
// improved management of watchables which don't hve time periods
//
// Revision 1.1  1999-10-12 15:34:06+01  ian_mayo
// Initial revision
//
// Revision 1.1  1999-08-26 10:03:16+01  administrator
// Initial revision
//

import MWC.GUI.Editable;

import java.util.Collection;

import junit.framework.TestCase;

public interface WatchableList extends ColoredWatchable, Editable
{
	/**
	 * the name of the property change event to fire should this object get
	 * filtered
	 * 
	 */
	public static final String FILTERED_PROPERTY = "WATCHABLE_FILTERED";

	/**
	 * the time threshold around a Watchable to decide if it is visible or not
	 * (value in micros)
	 */
	public static final long TIME_THRESHOLD = 120000000; // 2 minutes

	/**
	 * get the name of this list
	 * 
	 * @return the name of this list
	 */
	public String getName();

	/**
	 * get the start DTG of this list
	 * 
	 * @return the start DTG, or -1 if not time-related
	 */
	public HiResDate getStartDTG();

	/**
	 * get the end DTG of this list
	 * 
	 * @return the end DTG, or -1 if not time-related
	 */
	public HiResDate getEndDTG();

	/**
	 * find out if this object is visible
	 * 
	 * @return yes/no for visible
	 */
	public boolean getVisible();

	/**
	 * get the watchable in this list nearest to the specified DTG. If the
	 * watchable list has start/finish times, only return a fix if the DTG
	 * supplied is during the "live" period of the watchables. If not DTG is
	 * present, or an invalid DTG is requested ,return all valid points
	 * 
	 * @param DTG
	 *          to search for
	 * @return the nearest Watchable
	 */
	public Watchable[] getNearestTo(HiResDate DTG);

	/**
	 * filter the list to the specified time period
	 */
	public void filterListTo(HiResDate start, HiResDate end);<commit_msg>Introduce single fixed object for when getNearestTo() can't find anything<commit_after>/*
 *    Debrief - the Open Source Maritime Analysis Application
 *    http://debrief.info
 *
 *    (C) 2000-2014, PlanetMayo Ltd
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the Eclipse Public License v1.0
 *    (http://www.eclipse.org/legal/epl-v10.html)
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
 */
package MWC.GenericData;

// Copyright MWC 1999, Debrief 3 Project
// $RCSfile: WatchableList.java,v $
// @author $Author: Ian.Mayo $
// @version $Revision: 1.2 $
// $Log: WatchableList.java,v $
// Revision 1.2  2004/11/25 10:24:42  Ian.Mayo
// Switch to Hi Res dates
//
// Revision 1.1.1.2  2003/07/21 14:49:10  Ian.Mayo
// Re-import Java files to keep correct line spacing
//
// Revision 1.10  2003-05-08 16:00:57+01  ian_mayo
// remove unused imports
//
// Revision 1.9  2003-03-27 11:16:04+00  ian_mayo
// Update javadoc
//
// Revision 1.8  2003-03-19 15:37:21+00  ian_mayo
// improvements according to IntelliJ inspector
//
// Revision 1.7  2003-02-03 14:10:34+00  ian_mayo
// Add testing helper class
//
// Revision 1.6  2003-01-15 15:28:43+00  ian_mayo
// Improve comment
//
// Revision 1.5  2003-01-10 15:22:36+00  ian_mayo
// Add getVisible parameter
//
// Revision 1.4  2002-12-16 15:10:23+00  ian_mayo
// minor tidying
//
// Revision 1.3  2002-05-28 09:25:11+01  ian_mayo
// after switch to new system
//
// Revision 1.1  2002-05-28 09:11:44+01  ian_mayo
// Initial revision
//
// Revision 1.2  2002-05-08 14:40:50+01  ian_mayo
// make final objects static
//
// Revision 1.1  2002-04-23 12:28:40+01  ian_mayo
// Initial revision
//
// Revision 1.4  2002-03-13 08:46:49+00  administrator
// more comment improvements
//
// Revision 1.3  2002-03-13 08:40:33+00  administrator
// improve comments
//
// Revision 1.2  2001-10-01 12:49:53+01  administrator
// the getNearest method of WatchableList now returns an array of points (since a contact wrapper may contain several points at the same DTG).  We have had to reflect this across the application
//
// Revision 1.1  2001-08-06 16:57:43+01  administrator
// Add text field to use to categories the PropertyEvent when a watchable has been filtered
//
// Revision 1.0  2001-07-17 08:41:14+01  administrator
// Initial revision
//
// Revision 1.5  2001-01-15 11:19:01+00  novatech
// get the symbol to use for this list
//
// Revision 1.4  2001-01-11 15:37:11+00  novatech
// switch back to working with dates in long class format
//
// Revision 1.3  2001-01-11 11:53:02+00  novatech
// Before we switch from long dates to java.util.date dates.
//
// Revision 1.2  2001-01-09 10:28:40+00  novatech
// add extra parameters to allow WatchableLists to be used instead of TrackWrappers
//
// Revision 1.1  2001-01-03 13:40:27+00  novatech
// Initial revision
//
// Revision 1.1.1.1  2000/12/12 20:49:04  ianmayo
// initial import of files
//
// Revision 1.5  2000-10-16 11:50:46+01  ian_mayo
// changed default Time threshold for stepper
//
// Revision 1.4  2000-04-19 11:24:16+01  ian_mayo
// add time threshold parameter
//
// Revision 1.3  2000-04-03 10:20:25+01  ian_mayo
// add time-filtering method
//
// Revision 1.2  1999-10-15 12:37:16+01  ian_mayo
// improved management of watchables which don't hve time periods
//
// Revision 1.1  1999-10-12 15:34:06+01  ian_mayo
// Initial revision
//
// Revision 1.1  1999-08-26 10:03:16+01  administrator
// Initial revision
//

import MWC.GUI.Editable;

import java.util.Collection;

import junit.framework.TestCase;

public interface WatchableList extends ColoredWatchable, Editable
{
	/**
	 * the name of the property change event to fire should this object get
	 * filtered
	 * 
	 */
	public static final String FILTERED_PROPERTY = "WATCHABLE_FILTERED";

	/**
	 * the time threshold around a Watchable to decide if it is visible or not
	 * (value in micros)
	 */
	public static final long TIME_THRESHOLD = 120000000; // 2 minutes

	/**
	 * get the name of this list
	 * 
	 * @return the name of this list
	 */
	public String getName();

	/**
	 * get the start DTG of this list
	 * 
	 * @return the start DTG, or -1 if not time-related
	 */
	public HiResDate getStartDTG();

	/**
	 * get the end DTG of this list
	 * 
	 * @return the end DTG, or -1 if not time-related
	 */
	public HiResDate getEndDTG();

  /**
   * find out if this object is visible
   * 
   * @return yes/no for visible
   */
  public boolean getVisible();

  /**
   * get the watchable in this list nearest to the specified DTG. If the watchable list has
   * start/finish times, only return a fix if the DTG supplied is during the "live" period of the
   * watchables. If not DTG is present, or an invalid DTG is requested ,return all valid points
   * 
   * @param DTG
   *          to search for
   * @return the nearest Watchable, or EMPTY_WATCHABLE_LIST if empty
   */
  public Watchable[] getNearestTo(HiResDate DTG);

  /**
   * static instance of "null return" for getNearestTo(), when no items found
   * 
   */
  public static final Watchable[] EMPTY_WATCHABLE_LIST = new Watchable[]
  {};

	/**
	 * filter the list to the specified time period
	 */
	public void filterListTo(HiResDate start, HiResDate end);
{'fraction_non_alphanumeric': 0.11211315739510158, 'fraction_numerical': 0.1082209986709702, 'mean_word_length': 2.8817243920412676, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4227577', 'n_tokens_mistral': 4384, 'n_tokens_neox': 3551, 'n_words': 1238}