KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gnu > lists > VoidConsumer


1 // Copyright (c) 2000, 2001 Per M.A. Bothner and Brainfood Inc.
2
// This is free software; for terms and warranty disclaimer see ./COPYING.
3

4 package gnu.lists;
5
6 /** A Consumer that does nothing. */
7
8 public class VoidConsumer extends FilterConsumer
9 {
10   public static VoidConsumer instance = new VoidConsumer();
11
12   public static VoidConsumer getInstance() { return instance; }
13
14   public VoidConsumer()
15   {
16     super(null);
17     skipping = true;
18   }
19
20   /** True if consumer is ignoring rest of group.
21    * The producer can use this information to skip ahead. */

22   public boolean ignoring()
23   {
24     return true;
25   }
26 }
27
Popular Tags