Package it.unimi.dsi.big.webgraph
Class Transform.NodeClassFilter
- java.lang.Object
-
- it.unimi.dsi.big.webgraph.Transform.NodeClassFilter
-
- All Implemented Interfaces:
Transform.ArcFilter,Transform.LabelledArcFilter
- Enclosing class:
- Transform
public static final class Transform.NodeClassFilter extends java.lang.Object implements Transform.ArcFilter, Transform.LabelledArcFilter
An arc filter that only accepts arcs whose endpoints belong to the same (if the parameterkeepOnlySameis true) or to different (ifkeepOnlySameis false) classes. Classes are specified by one long per node, read from a given file inDataInputformat.
-
-
Constructor Summary
Constructors Constructor Description NodeClassFilter(java.lang.String classFile, boolean keepOnlySame)Creates a new instance.NodeClassFilter(java.lang.String classFile, java.lang.String keepOnlySame)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccept(long i, long j)Tells if the arc(i,j)has to be accepted or not.booleanaccept(long i, long j, Label label)Tells if the arc(i,j)with labellabelhas to be accepted or not.
-
-
-
Constructor Detail
-
NodeClassFilter
public NodeClassFilter(java.lang.String classFile, boolean keepOnlySame)Creates a new instance.- Parameters:
classFile- name of the class file.keepOnlySame- whether to keep nodes in the same class.
-
NodeClassFilter
public NodeClassFilter(java.lang.String classFile, java.lang.String keepOnlySame)Creates a new instance.This constructor has the same arguments as
NodeClassFilter(String,boolean), but it can be used with anObjectParser.- Parameters:
classFile- name of the class file.keepOnlySame- whether to keep nodes in the same class.
-
-
Method Detail
-
accept
public boolean accept(long i, long j)Description copied from interface:Transform.ArcFilterTells if the arc(i,j)has to be accepted or not.- Specified by:
acceptin interfaceTransform.ArcFilter- Parameters:
i- the source of the arc.j- the destination of the arc.- Returns:
- if the arc has to be accepted.
-
accept
public boolean accept(long i, long j, Label label)Description copied from interface:Transform.LabelledArcFilterTells if the arc(i,j)with labellabelhas to be accepted or not.- Specified by:
acceptin interfaceTransform.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.
-
-