KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > orb > ParserActionBase


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
8 package com.sun.corba.se.impl.orb ;
9
10 import java.util.Properties JavaDoc ;
11
12 import com.sun.corba.se.spi.orb.Operation ;
13
14 public abstract class ParserActionBase implements ParserAction {
15     private String JavaDoc propertyName ;
16     private boolean prefix ;
17     private Operation operation ;
18     private String JavaDoc fieldName ;
19
20     public int hashCode()
21     {
22     return propertyName.hashCode() ^ operation.hashCode() ^
23         fieldName.hashCode() ^ (prefix ? 0 : 1) ;
24     }
25
26     public boolean equals( Object JavaDoc obj )
27     {
28     if (obj == this)
29         return true ;
30
31     if (!(obj instanceof ParserActionBase))
32         return false ;
33
34     ParserActionBase other = (ParserActionBase)obj ;
35
36     return propertyName.equals( other.propertyName ) &&
37         prefix == other.prefix &&
38         operation.equals( other.operation ) &&
39         fieldName.equals( other.fieldName ) ;
40     }
41
42     public ParserActionBase( String JavaDoc propertyName, boolean prefix,
43     Operation operation, String JavaDoc fieldName )
44     {
45     this.propertyName = propertyName ;
46     this.prefix = prefix ;
47     this.operation = operation ;
48     this.fieldName = fieldName ;
49     }
50
51     public String JavaDoc getPropertyName()
52     {
53     return propertyName ;
54     }
55
56     public boolean isPrefix()
57     {
58     return prefix ;
59     }
60
61     public String JavaDoc getFieldName()
62     {
63     return fieldName ;
64     }
65
66     public abstract Object JavaDoc apply( Properties JavaDoc props ) ;
67
68     protected Operation getOperation()
69     {
70     return operation ;
71     }
72 }
73
74
Popular Tags