src/solaris/classes/sun/print/IPPPrintService.java

Print this page




1887                             responseMap = new HashMap();
1888                         }
1889 
1890                         byte outArray[] = outObj.toByteArray();
1891 
1892                         AttributeClass ac =
1893                             new AttributeClass(attribStr,
1894                                                valTagByte,
1895                                                outArray);
1896                         responseMap.put(ac.getName(), ac);
1897                     }
1898                 }
1899                 ois.close();
1900                 if ((responseMap != null) && (responseMap.size() > 0)) {
1901                     respList.add(responseMap);
1902                 }
1903                 return (HashMap[])respList.toArray(
1904                                   new HashMap[respList.size()]);
1905             } else {
1906                 debug_println(debugPrefix+
1907                               "readIPPResponse client error, IPP status code-"
1908                                    +Integer.toHexString(response[2])+" & "
1909                                    +Integer.toHexString(response[3]));
1910                 return null;
1911             }
1912 
1913         } catch (java.io.IOException e) {
1914             debug_println(debugPrefix+"readIPPResponse: "+e);
1915             if (debugPrint) {
1916                 e.printStackTrace();
1917             }
1918             return null;
1919         }
1920     }
1921 




1922 
1923     public String toString() {
1924         return "IPP Printer : " + getName();
1925     }
1926 
1927     public boolean equals(Object obj) {
1928         return  (obj == this ||
1929                  (obj instanceof IPPPrintService &&
1930                   ((IPPPrintService)obj).getName().equals(getName())));
1931     }
1932 
1933     public int hashCode() {
1934         return this.getClass().hashCode()+getName().hashCode();
1935     }
1936 }


1887                             responseMap = new HashMap();
1888                         }
1889 
1890                         byte outArray[] = outObj.toByteArray();
1891 
1892                         AttributeClass ac =
1893                             new AttributeClass(attribStr,
1894                                                valTagByte,
1895                                                outArray);
1896                         responseMap.put(ac.getName(), ac);
1897                     }
1898                 }
1899                 ois.close();
1900                 if ((responseMap != null) && (responseMap.size() > 0)) {
1901                     respList.add(responseMap);
1902                 }
1903                 return (HashMap[])respList.toArray(
1904                                   new HashMap[respList.size()]);
1905             } else {
1906                 debug_println(debugPrefix+
1907                           "readIPPResponse client error, IPP status code: 0x"+
1908                           toHex(response[2]) + toHex(response[3]));

1909                 return null;
1910             }
1911 
1912         } catch (java.io.IOException e) {
1913             debug_println(debugPrefix+"readIPPResponse: "+e);
1914             if (debugPrint) {
1915                 e.printStackTrace();
1916             }
1917             return null;
1918         }
1919     }
1920 
1921     private static String toHex(byte v) {
1922         String s = Integer.toHexString(v&0xff);
1923         return (s.length() == 2) ? s :  "0"+s;
1924     }
1925 
1926     public String toString() {
1927         return "IPP Printer : " + getName();
1928     }
1929 
1930     public boolean equals(Object obj) {
1931         return  (obj == this ||
1932                  (obj instanceof IPPPrintService &&
1933                   ((IPPPrintService)obj).getName().equals(getName())));
1934     }
1935 
1936     public int hashCode() {
1937         return this.getClass().hashCode()+getName().hashCode();
1938     }
1939 }