Source code: javax/ide/model/spi/XMLDocType.java
1 package javax.ide.model.spi;
2
3 public final class XMLDocType
4 {
5 private final String _publicId;
6 private final String _systemId;
7
8 public XMLDocType( String publicId, String systemId )
9 {
10 _publicId = publicId;
11 _systemId = systemId;
12 }
13
14 public String getPublicID()
15 {
16 return _publicId;
17 }
18
19 public String getSystemID()
20 {
21 return _systemId;
22 }
23
24 public boolean equals( Object o )
25 {
26 if ( o == this )
27 {
28 return true;
29 }
30 if ( !(o instanceof XMLDocType))
31 {
32 return false;
33 }
34 XMLDocType that = (XMLDocType)o;
35
36 return
37 ( that._publicId == null && _publicId == null &&
38 that._systemId == null && _systemId == null ) ||
39 ( that._publicId != null && that._publicId.equals( this._publicId ) &&
40 that._systemId != null && that._systemId.equals( this._systemId ) );
41 }
42
43 public int hashCode()
44 {
45 int hash = 42;
46 hash = _publicId == null ? hash : 37 * hash + _publicId.hashCode();
47 hash = _systemId == null ? hash : 37 * hash + _systemId.hashCode();
48
49 return hash;
50 }
51
52 public String toString()
53 {
54 return getClass().getName() + "[publicID="+
55 String.valueOf( _publicId ) + ", systemID=" +
56 String.valueOf( _systemId ) + "]";
57 }
58 }