View Javadoc
1   // NAME
2   //      $RCSfile: AsnNull.java,v $
3   // DESCRIPTION
4   //      [given below in javadoc format]
5   // DELTA
6   //      $Revision: 3.9 $
7   // CREATED
8   //      $Date: 2008/05/27 15:40:14 $
9   // COPYRIGHT
10  //      Westhawk Ltd
11  // TO DO
12  //
13  
14  /*
15   * Copyright (C) 1995, 1996 by West Consulting BV
16   *
17   * Permission to use, copy, modify, and distribute this software
18   * for any purpose and without fee is hereby granted, provided
19   * that the above copyright notices appear in all copies and that
20   * both the copyright notice and this permission notice appear in
21   * supporting documentation.
22   * This software is provided "as is" without express or implied
23   * warranty.
24   * author <a href="mailto:snmp@westhawk.co.uk">Tim Panton</a>
25   * original version by hargrave@dellgate.us.dell.com (Jordan Hargrave)
26   */
27  
28  /*
29   * Copyright (C) 1996 - 2006 by Westhawk Ltd
30   * <a href="www.westhawk.co.uk">www.westhawk.co.uk</a>
31   *
32   * Permission to use, copy, modify, and distribute this software
33   * for any purpose and without fee is hereby granted, provided
34   * that the above copyright notices appear in all copies and that
35   * both the copyright notice and this permission notice appear in
36   * supporting documentation.
37   * This software is provided "as is" without express or implied
38   * warranty.
39   * author <a href="mailto:snmp@westhawk.co.uk">Tim Panton</a>
40   */
41  
42  package uk.co.westhawk.snmp.stack;
43  
44  /*-
45   * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
46   * SNMP Java Client
47   * ჻჻჻჻჻჻
48   * Copyright 2023 MetricsHub, Westhawk
49   * ჻჻჻჻჻჻
50   * This program is free software: you can redistribute it and/or modify
51   * it under the terms of the GNU Lesser General Public License as
52   * published by the Free Software Foundation, either version 3 of the
53   * License, or (at your option) any later version.
54   *
55   * This program is distributed in the hope that it will be useful,
56   * but WITHOUT ANY WARRANTY; without even the implied warranty of
57   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
58   * GNU General Lesser Public License for more details.
59   *
60   * You should have received a copy of the GNU General Lesser Public
61   * License along with this program.  If not, see
62   * <http://www.gnu.org/licenses/lgpl-3.0.html>.
63   * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
64   */
65  
66  import java.io.*;
67  import java.util.*;
68  
69  /**
70   * This class represents the ASN.1 Null object
71   *
72   * @author <a href="mailto:snmp@westhawk.co.uk">Tim Panton</a>
73   * @version $Revision: 3.9 $ $Date: 2008/05/27 15:40:14 $
74   */
75  public class AsnNull extends AsnObject {
76      private static final String version_id = "@(#)$Id: AsnNull.java,v 3.9 2008/05/27 15:40:14 birgita Exp $ Copyright Westhawk Ltd";
77  
78      /**
79       * Default Constructor.
80       */
81      public AsnNull() {
82          type = ASN_NULL;
83      }
84  
85      /**
86       * Constructor.
87       *
88       * @param in  The input stream from which the value should be read
89       * @param len The length of the AsnInteger
90       */
91      public AsnNull(InputStream in, int len) {
92          this();
93      }
94  
95      /**
96       * Returns the string representation of the AsnNull.
97       *
98       * @return The string of the AsnNull
99       */
100     public String toString() {
101         return "AsnNull";
102     }
103 
104     void write(OutputStream out, int pos) throws IOException {
105         AsnBuildHeader(out, ASN_NULL, 0);
106     }
107 
108     /**
109      * Compares this object to the specified object.
110      * The result is <code>true</code> if and only if the argument is not
111      * <code>null</code> and is a <code>AsnNull</code> object.
112      *
113      * @param anObject the object to compare this <code>AsnNull</code>
114      *                 against.
115      * @return <code>true</code> if the <code>AsnNull </code>are equal;
116      *         <code>false</code> otherwise.
117      */
118     public boolean equals(Object anObject) {
119         if (this == anObject) {
120             return true;
121         }
122         if (anObject instanceof AsnNull) {
123             AsnNull anotherNull = (AsnNull) anObject;
124             return true;
125         }
126         return false;
127     }
128 
129     /**
130      * Returns a hash code for this object.
131      * 
132      * @return a hash code value for this object.
133      */
134     public int hashCode() {
135         int h = 5;
136         return h;
137     }
138 
139 }