org.hd.d.pg2k.svrCore.vars
Class EventVariableValueBuffer.Count

java.lang.Object
  extended by org.hd.d.pg2k.svrCore.vars.EventVariableValueBuffer.Count
All Implemented Interfaces:
java.io.ObjectInputValidation, java.io.Serializable, java.lang.Comparable<EventVariableValueBuffer.Count>
Enclosing class:
EventVariableValueBuffer

static final class EventVariableValueBuffer.Count
extends java.lang.Object
implements java.lang.Comparable<EventVariableValueBuffer.Count>, java.io.Serializable, java.io.ObjectInputValidation

Private class to contain an int count value. Contains the count of a particular value.

Is mutable to avoid unnecessary object churn in the heap.

When created has a count of 1.

Not thread-safe (access should be protected by other means).

Made available to EventVariableValue to help in canonicalising state.


Field Summary
(package private)  int count
          Count value; should be strictly positive.
private static long serialVersionUID
          Unique Serialisation class ID generated by http://random.hd.org/.
(package private)  java.lang.Object value
          Value (should be immutable); non-null.
 
Constructor Summary
EventVariableValueBuffer.Count(java.lang.Object o)
          Construct an instance with the given (non-null) event value.
 
Method Summary
 int compareTo(EventVariableValueBuffer.Count c)
          Provide total ordering with largest count (lowest rank) first.
protected  java.lang.Object readResolve()
          Deserialise: validate and then intern() value to economise on memory.
 void validateObject()
          Check that the object state is consistent and legal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

final java.lang.Object value
Value (should be immutable); non-null.


count

int count
Count value; should be strictly positive.


serialVersionUID

private static final long serialVersionUID
Unique Serialisation class ID generated by http://random.hd.org/.

See Also:
Constant Field Values
Constructor Detail

EventVariableValueBuffer.Count

EventVariableValueBuffer.Count(java.lang.Object o)
Construct an instance with the given (non-null) event value.

Method Detail

compareTo

public int compareTo(EventVariableValueBuffer.Count c)
Provide total ordering with largest count (lowest rank) first.

Specified by:
compareTo in interface java.lang.Comparable<EventVariableValueBuffer.Count>

validateObject

public void validateObject()
                    throws java.io.InvalidObjectException
Check that the object state is consistent and legal.

Specified by:
validateObject in interface java.io.ObjectInputValidation
Throws:
java.io.InvalidObjectException

readResolve

protected java.lang.Object readResolve()
                                throws java.io.ObjectStreamException
Deserialise: validate and then intern() value to economise on memory.

Throws:
java.io.ObjectStreamException

DHD Multimedia Gallery V1.57.21

Copyright (c) 1996-2011, Damon Hart-Davis. All rights reserved.