25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

39 lines
1005 B

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