it.unimi.dsi.webgraph.labelling
Class IntegerLabelFilter

java.lang.Object
  extended by it.unimi.dsi.webgraph.labelling.IntegerLabelFilter
All Implemented Interfaces:
Transform.LabelledArcFilter

public class IntegerLabelFilter
extends Object
implements Transform.LabelledArcFilter

A filter for labelled graphs preserving those arcs whose integer labels are in a specified set.

Author:
Sebastiano Vigna

Constructor Summary
IntegerLabelFilter(String... keyAndvalues)
          Creates a new integer-label filter.
IntegerLabelFilter(String key, int... value)
          Creates a new integer-label filter.
 
Method Summary
 boolean accept(int i, int j, Label label)
          Tells if the arc (i,j) with label label has to be accepted or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntegerLabelFilter

public IntegerLabelFilter(String key,
                          int... value)
Creates a new integer-label filter.

Parameters:
key - the key to be queried to filter an arc, or the empty string to query the well-known attribute.
value - a list of values that will be preserved.

IntegerLabelFilter

public IntegerLabelFilter(String... keyAndvalues)
Creates a new integer-label filter.

Parameters:
keyAndvalues - the key to be queried to filter an arc, or the empty string to query the well-known attribute, followed by a list of values that will be preserved.
Method Detail

accept

public boolean accept(int i,
                      int j,
                      Label label)
Description copied from interface: Transform.LabelledArcFilter
Tells if the arc (i,j) with label label has to be accepted or not.

Specified by:
accept in interface Transform.LabelledArcFilter
Parameters:
i - the source of the arc.
j - the destination of the arc.
label - the label of the arc.
Returns:
if the arc has to be accepted.