1. /*
  2. * @(#)ParserActionBase.java 1.8 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.corba.se.impl.orb ;
  8. import java.util.Properties ;
  9. import com.sun.corba.se.spi.orb.Operation ;
  10. public abstract class ParserActionBase implements ParserAction {
  11. private String propertyName ;
  12. private boolean prefix ;
  13. private Operation operation ;
  14. private String fieldName ;
  15. public int hashCode()
  16. {
  17. return propertyName.hashCode() ^ operation.hashCode() ^
  18. fieldName.hashCode() ^ (prefix ? 0 : 1) ;
  19. }
  20. public boolean equals( Object obj )
  21. {
  22. if (obj == this)
  23. return true ;
  24. if (!(obj instanceof ParserActionBase))
  25. return false ;
  26. ParserActionBase other = (ParserActionBase)obj ;
  27. return propertyName.equals( other.propertyName ) &&
  28. prefix == other.prefix &&
  29. operation.equals( other.operation ) &&
  30. fieldName.equals( other.fieldName ) ;
  31. }
  32. public ParserActionBase( String propertyName, boolean prefix,
  33. Operation operation, String fieldName )
  34. {
  35. this.propertyName = propertyName ;
  36. this.prefix = prefix ;
  37. this.operation = operation ;
  38. this.fieldName = fieldName ;
  39. }
  40. public String getPropertyName()
  41. {
  42. return propertyName ;
  43. }
  44. public boolean isPrefix()
  45. {
  46. return prefix ;
  47. }
  48. public String getFieldName()
  49. {
  50. return fieldName ;
  51. }
  52. public abstract Object apply( Properties props ) ;
  53. protected Operation getOperation()
  54. {
  55. return operation ;
  56. }
  57. }