com.mucommander.runtime
Class RuntimeProperty

java.lang.Object
  extended by com.mucommander.runtime.RuntimeProperty
Direct Known Subclasses:
ComparableRuntimeProperty, OsFamily

public abstract class RuntimeProperty
extends java.lang.Object

This abstract class represents a property of the runtime environment. A runtime property has a finite number of values -- each value having a corresponding RuntimeProperty instance, and only one. Subclasses must ensure that only instance exists per runtime value. Based on this assumption, RuntimeProperty instances can be compared using the shallow equals operator '=='.

When running on a JVM, a RuntimeProperty has a runtime value (and only one), which can be retrieved using getCurrentValue().

Author:
Maxence Bernard

Field Summary
protected  java.lang.String stringRepresentation
          The String representation of this RuntimeProperty, set at creation time
 
Constructor Summary
protected RuntimeProperty(java.lang.String stringRepresentation)
          Creates a new RuntimeProperty using the specified String representation.
 
Method Summary
protected abstract  RuntimeProperty getCurrentValue()
          Returns the current runtime environment's value of this runtime property.
 boolean isCurrent()
          Returns true if this instance is the same instance as the one returned by getCurrentValue().
 java.lang.String toString()
          Returns the String representation passed to the constructor at creation time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

stringRepresentation

protected final java.lang.String stringRepresentation
The String representation of this RuntimeProperty, set at creation time

Constructor Detail

RuntimeProperty

protected RuntimeProperty(java.lang.String stringRepresentation)
Creates a new RuntimeProperty using the specified String representation.

Parameters:
stringRepresentation - a String representation of this property
Method Detail

isCurrent

public boolean isCurrent()
Returns true if this instance is the same instance as the one returned by getCurrentValue().

Returns:
true if this instance is the same as the current runtime's value

toString

public java.lang.String toString()
Returns the String representation passed to the constructor at creation time.

Overrides:
toString in class java.lang.Object
Returns:
the String representation passed to the constructor at creation time

getCurrentValue

protected abstract RuntimeProperty getCurrentValue()
Returns the current runtime environment's value of this runtime property.

Returns:
the current runtime environment's value of this runtime property


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard