[jboss-cvs] JBossCache/src/org/jboss/cache/eviction ...
Brian Stansberry
brian.stansberry at jboss.com
Wed Oct 11 23:39:09 EDT 2006
User: bstansberry
Date: 06/10/11 23:39:09
Modified: src/org/jboss/cache/eviction EvictedEventNode.java
Log:
[JBCACHE-801] Use enum for node event types
Revision Changes Path
1.6 +10 -20 JBossCache/src/org/jboss/cache/eviction/EvictedEventNode.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: EvictedEventNode.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/EvictedEventNode.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- EvictedEventNode.java 8 Jun 2006 17:37:39 -0000 1.5
+++ EvictedEventNode.java 12 Oct 2006 03:39:09 -0000 1.6
@@ -17,33 +17,23 @@
*/
public class EvictedEventNode
{
- // Signal the operation types.
- public static final int ADD_NODE_EVENT = 0;
- public static final int REMOVE_NODE_EVENT = 1;
- public static final int VISIT_NODE_EVENT = 2;
- public static final int ADD_ELEMENT_EVENT = 3;
- public static final int REMOVE_ELEMENT_EVENT = 4;
- public static final int MARK_IN_USE_EVENT = 5;
- public static final int UNMARK_USE_EVENT = 6;
-
private Fqn fqn_;
- private int event_;
+ private NodeEventType type_;
private int elementDifference_;
private boolean resetElementCount_;
private long inUseTimeout;
- public EvictedEventNode(Fqn fqn, int event, int elementDifference)
+ public EvictedEventNode(Fqn fqn, NodeEventType type, int elementDifference)
{
- setFqn(fqn);
- setEvent(event);
+ this(fqn, type);
setElementDifference(elementDifference);
}
- public EvictedEventNode(Fqn fqn, int event)
+ public EvictedEventNode(Fqn fqn, NodeEventType event)
{
setFqn(fqn);
- setEvent(event);
+ setEventType(event);
}
public long getInUseTimeout()
@@ -86,18 +76,18 @@
this.fqn_ = fqn;
}
- public void setEvent(int event)
+ public void setEventType(NodeEventType event)
{
- event_ = event;
+ type_ = event;
}
- public int getEvent()
+ public NodeEventType getEventType()
{
- return event_;
+ return type_;
}
public String toString()
{
- return "EvictedEN[fqn=" + fqn_ + " event=" + event_ + " diff=" + elementDifference_ + "]";
+ return "EvictedEN[fqn=" + fqn_ + " event=" + type_ + " diff=" + elementDifference_ + "]";
}
}
More information about the jboss-cvs-commits
mailing list