package org.freertr.spf; import java.util.ArrayList; import java.util.List; import org.freertr.addr.addrIP; import org.freertr.addr.addrPrefix; import org.freertr.addr.addrType; /** * spf prefix * * @param type of nodes * @author matecsaba */ public class spfPrefix implements Comparable> { /** * prefix */ protected final addrPrefix prefix; /** * nodes */ protected final List> nodes = new ArrayList>(); /** * create instance * * @param pfx prefix */ public spfPrefix(addrPrefix pfx) { prefix = pfx; } public String toString() { String a = ""; for (int i = 0; i < nodes.size(); i++) { a += " " + nodes.get(i); } return addrPrefix.ip2str(prefix) + "|" + a; } public int compareTo(spfPrefix o) { return prefix.compareTo(o.prefix); } }