1 /* |
1 /* |
2 * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
395 } |
395 } |
396 |
396 |
397 public int compareTo(Object o) { |
397 public int compareTo(Object o) { |
398 try { |
398 try { |
399 return qName.compareTo(((AttributeValueHolder) o).qName); |
399 return qName.compareTo(((AttributeValueHolder) o).qName); |
400 } |
400 } catch (Exception e) { |
401 catch (Exception e) { |
|
402 throw new RuntimeException(CommonResourceBundle.getInstance().getString("message.AttributeValueHolderExpected")); |
401 throw new RuntimeException(CommonResourceBundle.getInstance().getString("message.AttributeValueHolderExpected")); |
403 } |
402 } |
404 } |
403 } |
|
404 |
|
405 @Override |
|
406 public boolean equals(Object o) { |
|
407 try { |
|
408 return (o instanceof AttributeValueHolder) && |
|
409 qName.equals(((AttributeValueHolder) o).qName); |
|
410 } catch (Exception e) { |
|
411 throw new RuntimeException(CommonResourceBundle.getInstance().getString("message.AttributeValueHolderExpected")); |
|
412 } |
|
413 } |
|
414 |
|
415 @Override |
|
416 public int hashCode() { |
|
417 int hash = 7; |
|
418 hash = 97 * hash + (this.qName != null ? this.qName.hashCode() : 0); |
|
419 return hash; |
|
420 } |
405 } |
421 } |
406 |
422 |
407 } |
423 } |