net.sourceforge.fuzzyservices.beans
Class FuzzyInterval

java.lang.Object
  extended by net.sourceforge.fuzzyservices.beans.FuzzyInterval
All Implemented Interfaces:
PropertyChangeListener, VetoableChangeListener, Serializable, EventListener

public class FuzzyInterval
extends Object
implements Serializable, PropertyChangeListener, VetoableChangeListener

This class represents a fuzzy interval according to JavaBeans conventions.

Version:
1.0
Author:
Uwe Weng
See Also:
FuzzyInterval, Serialized Form

Field Summary
static String MEMBERSHIP_FUNCTION_PROPERTY
          Bound property name for membershipFunction.
static String NEGATIVE_PROPERTY
          Bound property name for negative.
static String POSITIVE_PROPERTY
          Bound property name for positive.
static String VALID_FUZZY_LR_INTERVAL_PROPERTY
          Bound property name for validFuzzyLRInterval.
 
Constructor Summary
FuzzyInterval()
          Default FuzzyInterval constructor.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangeListener to the listener list.
 Object clone()
           
 boolean equals(Object obj)
           
 int getId()
          Returns the technical identifier (e.g. within a database).
 MembershipFunction getMembershipFunction()
          Returns the membership function.
 int hashCode()
           
 void invert()
          Inverts this fuzzy interval.
 boolean isNegative()
          Checks whether the fuzzy interval is negative.
 boolean isPositive()
          Checks whether the fuzzy interval is positive.
 boolean isValidFuzzyLRInterval()
          Checks whether the fuzzy interval fulfills the requirements of a fuzzy LR interval.
 void negate()
          Negates the fuzzy interval.
 void propertyChange(PropertyChangeEvent evt)
           
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes a PropertyChangeListener from the listener list.
 void setMembershipFunction(MembershipFunction newMembershipFunction)
          Sets the membership function.
 String toString()
           
 String toString(boolean withMembershipFunction)
          Returns a textual representation of the fuzzy interval
 void vetoableChange(PropertyChangeEvent evt)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MEMBERSHIP_FUNCTION_PROPERTY

public static final String MEMBERSHIP_FUNCTION_PROPERTY
Bound property name for membershipFunction.

See Also:
Constant Field Values

NEGATIVE_PROPERTY

public static final String NEGATIVE_PROPERTY
Bound property name for negative.

See Also:
Constant Field Values

POSITIVE_PROPERTY

public static final String POSITIVE_PROPERTY
Bound property name for positive.

See Also:
Constant Field Values

VALID_FUZZY_LR_INTERVAL_PROPERTY

public static final String VALID_FUZZY_LR_INTERVAL_PROPERTY
Bound property name for validFuzzyLRInterval.

See Also:
Constant Field Values
Constructor Detail

FuzzyInterval

public FuzzyInterval()
Default FuzzyInterval constructor. This constructor creates a valid default fuzzy interval with the coordinates (0.0, 0.0), (1.0, 1.0), (2.0, 1.0) and (3.0, 0.0).

Method Detail

getId

public int getId()
Returns the technical identifier (e.g. within a database).

Returns:
the ID

getMembershipFunction

public final MembershipFunction getMembershipFunction()
Returns the membership function.

Returns:
the membershipFunction property
See Also:
setMembershipFunction(MembershipFunction)

setMembershipFunction

public final void setMembershipFunction(MembershipFunction newMembershipFunction)
Sets the membership function.

Parameters:
newMembershipFunction - The new value for the property.
See Also:
getMembershipFunction()

invert

public final void invert()
                  throws PropertyVetoException
Inverts this fuzzy interval.

Throws:
PropertyVetoException - when the attempt to set the property is vetoed by a listener

isNegative

public final boolean isNegative()
Checks whether the fuzzy interval is negative. A fuzzy interval is negative if degree of membership is only greater than zero when x is lower than zero.

Returns:
true if fuzzy interval is negative, false otherwise

isPositive

public final boolean isPositive()
Checks whether the fuzzy interval is positive. A fuzzy interval is positive if degree of membership is only greater than zero when x is also greater than zero.

Returns:
true if fuzzy interval is positive, false otherwise

isValidFuzzyLRInterval

public final boolean isValidFuzzyLRInterval()
Checks whether the fuzzy interval fulfills the requirements of a fuzzy LR interval. In addition to the requirements for a fuzzy interval the membership function must be represented by two reference function L and R.

Returns:
true if the fuzzy interval would be a fuzzy LR interval false, otherwise
See Also:
#isValidFuzzyInterval

negate

public final void negate()
                  throws PropertyVetoException
Negates the fuzzy interval.

Throws:
PropertyVetoException - when the attempt to set the property is vetoed by a listener

addPropertyChangeListener

public final void addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list. The listener is registered for all properties.

A PropertyChangeEvent will get fired in response to setting a bound property.

Parameters:
listener - the PropertyChangeListener to be added

removePropertyChangeListener

public final void removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.

Parameters:
listener - the PropertyChangeListener to be removed

propertyChange

public final void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener

vetoableChange

public final void vetoableChange(PropertyChangeEvent evt)
                          throws PropertyVetoException
Specified by:
vetoableChange in interface VetoableChangeListener
Throws:
PropertyVetoException

clone

public Object clone()
Overrides:
clone in class Object

equals

public final boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

toString

public String toString(boolean withMembershipFunction)
Returns a textual representation of the fuzzy interval

Parameters:
withMembershipFunction - true if all points of membership function are also returned, false otherwise.
Returns:
a string representation of the fuzzy interval
See Also:
MembershipFunction.toString()


Copyright © 2007-2012 Fuzzy Services. All Rights Reserved.