You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

41 rivejä
1.0 KiB

  1. /**
  2. * libcaca Java bindings for libcaca
  3. * Copyright (c) 2009 Adrien Grand <jpountz@dinauz.org>
  4. *
  5. * $Id$
  6. *
  7. * This library is free software. It comes without any warranty, to
  8. * the extent permitted by applicable law. You can redistribute it
  9. * and/or modify it under the terms of the Do What The Fuck You Want
  10. * To Public License, Version 2, as published by Sam Hocevar. See
  11. * http://sam.zoy.org/wtfpl/COPYING for more details.
  12. */
  13. package org.zoy.caca;
  14. public abstract class CacaObject {
  15. protected String code;
  16. protected String description;
  17. public CacaObject(String code, String desc) {
  18. this.code = code;
  19. this.description = desc;
  20. }
  21. public String getCode() {
  22. return code;
  23. }
  24. public String getDescription() {
  25. return description;
  26. }
  27. @Override
  28. public boolean equals(Object o) {
  29. if (o == null) return false;
  30. if (this.getClass().equals(o.getClass())) {
  31. CacaObject other = (CacaObject)o;
  32. return this.code.equals(other.code);
  33. }
  34. return false;
  35. }
  36. }