/v3.2/nimbits-tds/src/com/nimbits/shared/Utils.java

http://nimbits-server.googlecode.com/ · Java · 35 lines · 10 code · 6 blank · 19 comment · 3 complexity · 1c29794fae2d0d095c3d24a715561dbb MD5 · raw file

  1. /*
  2. * Copyright (c) 2010 Tonic Solutions LLC.
  3. *
  4. * http://www.nimbits.com
  5. *
  6. *
  7. * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
  8. *
  9. * http://www.gnu.org/licenses/gpl.html
  10. *
  11. * Unless required by applicable law or agreed to in writing, software distributed under the license is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
  12. */
  13. package com.nimbits.shared;
  14. /**
  15. * Created by bsautner
  16. * User: benjamin
  17. * Date: 6/11/11
  18. * Time: 9:04 AM
  19. *
  20. */
  21. public class Utils {
  22. public static boolean isEmptyString(final String string) {
  23. return (string == null || string.trim().length() == 0);
  24. }
  25. public static double roundDouble(final double d) {
  26. int ix = (int)(d * 100.0); // scale it
  27. return ((double)ix)/100.0;
  28. }
  29. }