home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2007 April / PCpro_2007_04.ISO / files / dsl / jNetTool.exe / org / xbill / DNS / Opcode.class (.txt) < prev    next >
Encoding:
Java Class File  |  2005-06-05  |  1.2 KB  |  33 lines

  1. package org.xbill.DNS;
  2.  
  3. public final class Opcode {
  4.    public static final int QUERY = 0;
  5.    public static final int IQUERY = 1;
  6.    public static final int STATUS = 2;
  7.    public static final int NOTIFY = 4;
  8.    public static final int UPDATE = 5;
  9.    private static Mnemonic opcodes = new Mnemonic("DNS Opcode", 2);
  10.  
  11.    static {
  12.       opcodes.setMaximum(15);
  13.       opcodes.setPrefix("RESERVED");
  14.       opcodes.setNumericAllowed(true);
  15.       opcodes.add(0, "QUERY");
  16.       opcodes.add(1, "IQUERY");
  17.       opcodes.add(2, "STATUS");
  18.       opcodes.add(4, "NOTIFY");
  19.       opcodes.add(5, "UPDATE");
  20.    }
  21.  
  22.    private Opcode() {
  23.    }
  24.  
  25.    public static String string(int i) {
  26.       return opcodes.getText(i);
  27.    }
  28.  
  29.    public static int value(String s) {
  30.       return opcodes.getValue(s);
  31.    }
  32. }
  33.