org.openstreetmap.osmosis.core.filter.common
Class ListIdTracker

java.lang.Object
  extended by org.openstreetmap.osmosis.core.filter.common.ListIdTracker
All Implemented Interfaces:
java.lang.Iterable<java.lang.Long>, IdTracker

public class ListIdTracker
extends java.lang.Object
implements IdTracker

Implements the IdTracker interface using a list of ids. The current implementation only supports 31 bit numbers, but will be enhanced if and when required.

Author:
Brett Henderson

Constructor Summary
ListIdTracker()
          Creates a new instance.
 
Method Summary
 boolean get(long id)
          Checks whether the specified id is active.
 java.util.Iterator<java.lang.Long> iterator()
          
 void set(long id)
          Marks the specified id as active.
 void setAll(IdTracker idTracker)
          Sets all the ids contained in the specified tracker.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListIdTracker

public ListIdTracker()
Creates a new instance.

Method Detail

set

public void set(long id)
Marks the specified id as active.

Specified by:
set in interface IdTracker
Parameters:
id - The identifier to be flagged.

get

public boolean get(long id)
Checks whether the specified id is active.

Specified by:
get in interface IdTracker
Parameters:
id - The identifier to be checked.
Returns:
True if the identifier is active, false otherwise.

iterator

public java.util.Iterator<java.lang.Long> iterator()

Specified by:
iterator in interface java.lang.Iterable<java.lang.Long>

setAll

public void setAll(IdTracker idTracker)
Sets all the ids contained in the specified tracker.

Specified by:
setAll in interface IdTracker
Parameters:
idTracker - The id tracker containing the ids to set.