📄 section.java
字号:
// Copyright (c) 1999-2004 Brian Wellington (bwelling@xbill.org)package org.xbill.DNS;/** * Constants and functions relating to DNS message sections * * @author Brian Wellington */public final class Section {/** The question (first) section */public static final int QUESTION = 0;/** The answer (second) section */public static final int ANSWER = 1;/** The authority (third) section */public static final int AUTHORITY = 2;/** The additional (fourth) section */public static final int ADDITIONAL = 3;/* Aliases for dynamic update *//** The zone (first) section of a dynamic update message */public static final int ZONE = 0;/** The prerequisite (second) section of a dynamic update message */public static final int PREREQ = 1;/** The update (third) section of a dynamic update message */public static final int UPDATE = 2;private static Mnemonic sections = new Mnemonic("Message Section", Mnemonic.CASE_LOWER);private static String [] longSections = new String[4];private static String [] updateSections = new String[4];static { sections.setMaximum(3); sections.setNumericAllowed(true); sections.add(QUESTION, "qd"); sections.add(ANSWER, "an"); sections.add(AUTHORITY, "au"); sections.add(ADDITIONAL, "ad"); longSections[QUESTION] = "QUESTIONS"; longSections[ANSWER] = "ANSWERS"; longSections[AUTHORITY] = "AUTHORITY RECORDS"; longSections[ADDITIONAL] = "ADDITIONAL RECORDS"; updateSections[ZONE] = "ZONE"; updateSections[PREREQ] = "PREREQUISITES"; updateSections[UPDATE] = "UPDATE RECORDS"; updateSections[ADDITIONAL] = "ADDITIONAL RECORDS";}privateSection() {}/** Converts a numeric Section into an abbreviation String */public static Stringstring(int i) { return sections.getText(i);}/** Converts a numeric Section into a full description String */public static StringlongString(int i) { sections.check(i); return longSections[i];}/** * Converts a numeric Section into a full description String for an update * Message. */public static StringupdString(int i) { sections.check(i); return updateSections[i];}/** Converts a String representation of a Section into its numeric value */public static intvalue(String s) { return sections.getValue(s);}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -