Tests if the given object is equal to this type. @param object the object to be compared to this type. @return true if the given object is equal to this type.
(final Object object)
| 851 | * @return <tt>true</tt> if the given object is equal to this type. |
| 852 | */ |
| 853 | @Override |
| 854 | public boolean equals(final Object object) { |
| 855 | if (this == object) { |
| 856 | return true; |
| 857 | } |
| 858 | if (!(object instanceof Type)) { |
| 859 | return false; |
| 860 | } |
| 861 | Type other = (Type) object; |
| 862 | if ((sort == INTERNAL ? OBJECT : sort) != (other.sort == INTERNAL ? OBJECT : other.sort)) { |
| 863 | return false; |
| 864 | } |
| 865 | int begin = valueBegin; |
| 866 | int end = valueEnd; |
| 867 | int otherBegin = other.valueBegin; |
| 868 | int otherEnd = other.valueEnd; |
| 869 | // Compare the values. |
| 870 | if (end - begin != otherEnd - otherBegin) { |
| 871 | return false; |
| 872 | } |
| 873 | for (int i = begin, j = otherBegin; i < end; i++, j++) { |
| 874 | if (valueBuffer.charAt(i) != other.valueBuffer.charAt(j)) { |
| 875 | return false; |
| 876 | } |
| 877 | } |
| 878 | return true; |
| 879 | } |
| 880 | |
| 881 | /** |
| 882 | * Returns a hash code value for this type. |
no outgoing calls
no test coverage detected