|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mucommander.runtime.RuntimeProperty
com.mucommander.runtime.ComparableRuntimeProperty
public abstract class ComparableRuntimeProperty
ComparableRuntimeProperty is a runtime property for which the values have a natural order. This class provides methods to compare instances, using an int value specified at creation time as the discriminator.
The subclass must ensure that no two instances have the same discriminator value. Based on this assumption,
if compareTo(Object) returns 0, then instances are equal according to the shallow equals
operator '=='.
| Field Summary | |
|---|---|
protected int |
discriminator
The descriminator set at creation time |
| Fields inherited from class com.mucommander.runtime.RuntimeProperty |
|---|
stringRepresentation |
| Constructor Summary | |
|---|---|
protected |
ComparableRuntimeProperty(java.lang.String stringRepresentation,
int discriminator)
Creates a new RuntimeProperty using the specified String representation and order discriminator. |
| Method Summary | |
|---|---|
int |
compareTo(java.lang.Object o)
|
boolean |
isCurrentHigher()
Returns true if the current runtime's value of this property is higher than this instance,
according to compareTo(Object). |
boolean |
isCurrentLower()
Returns true if the current runtime's value of this property is lower than this instance,
according to compareTo(Object). |
boolean |
isCurrentOrHigher()
Returns true if the current runtime's value of this property is equal or higher to this instance,
according to compareTo(Object). |
boolean |
isCurrentOrLower()
Returns true if the current runtime's value of this property is equal or lower to this instance,
according to compareTo(Object). |
| Methods inherited from class com.mucommander.runtime.RuntimeProperty |
|---|
getCurrentValue, isCurrent, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final int discriminator
| Constructor Detail |
|---|
protected ComparableRuntimeProperty(java.lang.String stringRepresentation,
int discriminator)
stringRepresentation - a String representation of this propertydiscriminator - the descriminator that serves to compare an instance with another against| Method Detail |
|---|
public boolean isCurrentOrLower()
true if the current runtime's value of this property is equal or lower to this instance,
according to compareTo(Object).
true if the current runtime's value of this property is equal or lower to this instancepublic boolean isCurrentLower()
true if the current runtime's value of this property is lower than this instance,
according to compareTo(Object).
true if the current runtime's value of this property is lower than this instancepublic boolean isCurrentOrHigher()
true if the current runtime's value of this property is equal or higher to this instance,
according to compareTo(Object).
true if the current runtime's value of this property is equal or higher to this instancepublic boolean isCurrentHigher()
true if the current runtime's value of this property is higher than this instance,
according to compareTo(Object).
true if the current runtime's value of this property is higher than this instancepublic int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard