<commit_before>// Copyright (c) 2004 <NAME> (<EMAIL>)

package org.xbill.DNS;

import java.io.*;
import java.net.*;
import java.util.*;
import org.xbill.DNS.utils.*;

/**
 * APL - Address Prefix List.
 *
 * @author <NAME>
 */

/*
 * Note: this currently uses the same constants as the Address class;
 * this could change if more constants are defined for APL records.
 */

public class APLRecord extends Record {

public static class Element {
	public final int family;
	public final boolean negative;
	public final int prefixLength;
	public final Object address;


	private
	Element(int family, boolean negative, Object address, int prefixLength)
	{
		this.family = family;
		this.negative = negative;
		this.address = address;
		this.prefixLength = prefixLength;
		if (!validatePrefixLength(family, prefixLength)) {
			throw new IllegalArgumentException("invalid prefix " +
							   "length");
		}
	}

	/**
	 * Creates an APL element corresponding to an IPv4 or IPv6 prefix.
	 * @param negative Indicates if this prefix is a negation.
	 * @param address The IPv4 or IPv6 address.
	 * @param prefixLength The length of this prefix, in bits.
	 * @throws IllegalArgumentException The prefix length is invalid.
	 */
	public
	Element(boolean negative, InetAddress address, int prefixLength) {
		this(Address.familyOf(address), negative, address,
		     prefixLength);
	}

	public String
	toString() {
		StringBuffer sb = new StringBuffer();
		if (negative)
			sb.append("!");
		sb.append(family);
		sb.append(":");
		if (family == Address.IPv4 || family == Address.IPv6)
			sb.append(((InetAddress) address).getHostAddress());
		else
			sb.append(base16.toString((byte []) address));
		sb.append("/");
		sb.append(prefixLength);
		return sb.toString();
	}
}

private List elements;

APLRecord() {} 

Record
getObject() {
	return new APLRecord();
}<commit_msg>Add reference to RFC and APLRecord.Element.equals().<commit_after>// Copyright (c) 2004 <NAME> (<EMAIL>)

package org.xbill.DNS;

import java.io.*;
import java.net.*;
import java.util.*;
import org.xbill.DNS.utils.*;

/**
 * APL - Address Prefix List.  See RFC 3123.
 *
 * @author <NAME>
 */

/*
 * Note: this currently uses the same constants as the Address class;
 * this could change if more constants are defined for APL records.
 */

public class APLRecord extends Record {

public static class Element {
	public final int family;
	public final boolean negative;
	public final int prefixLength;
	public final Object address;

	private
	Element(int family, boolean negative, Object address, int prefixLength)
	{
		this.family = family;
		this.negative = negative;
		this.address = address;
		this.prefixLength = prefixLength;
		if (!validatePrefixLength(family, prefixLength)) {
			throw new IllegalArgumentException("invalid prefix " +
							   "length");
		}
	}

	/**
	 * Creates an APL element corresponding to an IPv4 or IPv6 prefix.
	 * @param negative Indicates if this prefix is a negation.
	 * @param address The IPv4 or IPv6 address.
	 * @param prefixLength The length of this prefix, in bits.
	 * @throws IllegalArgumentException The prefix length is invalid.
	 */
	public
	Element(boolean negative, InetAddress address, int prefixLength) {
		this(Address.familyOf(address), negative, address,
		     prefixLength);
	}

	public String
	toString() {
		StringBuffer sb = new StringBuffer();
		if (negative)
			sb.append("!");
		sb.append(family);
		sb.append(":");
		if (family == Address.IPv4 || family == Address.IPv6)
			sb.append(((InetAddress) address).getHostAddress());
		else
			sb.append(base16.toString((byte []) address));
		sb.append("/");
		sb.append(prefixLength);
		return sb.toString();
	}

	public boolean
	equals(Object arg) {
		if (arg == null || !(arg instanceof Element))
			return false;
		Element elt = (Element) arg;
		return (family == elt.family &&
			negative == elt.negative &&
			prefixLength == elt.prefixLength &&
			address.equals(elt.address));
	}
}

private List elements;

APLRecord() {} 

Record
getObject() {
	return new APLRecord();
}
{'fraction_non_alphanumeric': 0.12023750618505691, 'fraction_numerical': 0.006927263730826323, 'mean_word_length': 3.8419161676646705, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '95373', 'n_tokens_mistral': 1314, 'n_tokens_neox': 1189, 'n_words': 398}