Changeset 13231 in josm for trunk/src/org/glassfish/json/JsonNumberImpl.java
- Timestamp:
- 2017-12-23T02:40:43+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/glassfish/json/JsonNumberImpl.java
r6756 r13231 2 2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 3 3 * 4 * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. 4 * Copyright (c) 2013-2017 Oracle and/or its affiliates. All rights reserved. 5 5 * 6 6 * The contents of this file are subject to the terms of either the GNU … … 9 9 * may not use this file except in compliance with the License. You can 10 10 * obtain a copy of the License at 11 * https:// glassfish.dev.java.net/public/CDDL+GPL_1_1.html12 * or packager/legal/LICENSE.txt. See the License for the specific11 * https://oss.oracle.com/licenses/CDDL+GPL-1.1 12 * or LICENSE.txt. See the License for the specific 13 13 * language governing permissions and limitations under the License. 14 14 * 15 15 * When distributing the software, include this License Header Notice in each 16 * file and include the License file at packager/legal/LICENSE.txt.16 * file and include the License file at LICENSE.txt. 17 17 * 18 18 * GPL Classpath Exception: … … 126 126 127 127 @Override 128 public Number numberValue() { 129 return num; 130 } 131 132 @Override 128 133 public String toString() { 129 134 return Integer.toString(num); … … 143 148 public boolean isIntegral() { 144 149 return true; 150 } 151 152 @Override 153 public int intValue() { 154 return (int) num; 155 } 156 157 @Override 158 public int intValueExact() { 159 return Math.toIntExact(num); 145 160 } 146 161 … … 172 187 173 188 @Override 189 public Number numberValue() { 190 return num; 191 } 192 193 @Override 174 194 public String toString() { 175 195 return Long.toString(num); … … 191 211 } 192 212 213 @Override 214 public Number numberValue() { 215 return bigDecimalValue(); 216 } 217 193 218 } 194 219 … … 245 270 @Override 246 271 public boolean equals(Object obj) { 272 if (this == obj){ 273 return true; 274 } 247 275 if (!(obj instanceof JsonNumber)) { 248 276 return false;
Note:
See TracChangeset
for help on using the changeset viewer.