org.jmythapi.impl
Class AVersionRange<V extends Enum<V> & IVersion>

java.lang.Object
  extended by org.jmythapi.impl.AVersionRange<V>
Direct Known Subclasses:
DatabaseVersionRange, ProtocolVersionRange

public abstract class AVersionRange<V extends Enum<V> & IVersion>
extends Object


Field Summary
protected  V fromVersion
          The lower-value of the version range.
protected  V toVersion
          The higher-value of the version range.
 
Constructor Summary
AVersionRange(V from, V to)
          Constructs a version-range object from two version objects
 
Method Summary
 boolean equals(Object paramObject)
           
 V from()
          Returns the version when a command or property was introduced.
abstract  boolean isInRange(int protoVersionNr)
          Checks if the specified protocol-version is in this version-range.
 boolean isInRange(V protoVersion)
          Checks if the specified protocol-version is in this version-range.
 V to()
          Returns the version when a command or property was removed.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fromVersion

protected final V extends Enum<V> & IVersion fromVersion
The lower-value of the version range.


toVersion

protected final V extends Enum<V> & IVersion toVersion
The higher-value of the version range.

Constructor Detail

AVersionRange

public AVersionRange(V from,
                     V to)
Constructs a version-range object from two version objects

Parameters:
from - the lower bound
to - the upper bound
Method Detail

from

public V from()
Returns the version when a command or property was introduced.

Returns:
the version when a command or property was introduced.

to

public V to()
Returns the version when a command or property was removed.

For example a value of 3 means, that the command or property is supported till version 2.

The maximum supported version can be determined by calling ProtocolVersion.getMaxVersion().

Returns:
the protocol-version when a command or property was removed

isInRange

public boolean isInRange(V protoVersion)
Checks if the specified protocol-version is in this version-range.

Parameters:
protoVersion - the protocol-version to check
Returns:
true if the given version is in the range.

isInRange

public abstract boolean isInRange(int protoVersionNr)
Checks if the specified protocol-version is in this version-range.

Parameters:
protoVersionNr - the protocol-version to check
Returns:
true if the given version is in the range.

equals

public boolean equals(Object paramObject)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008-2013. All Rights Reserved.