org.opensha.sra.riskmaps.func
Class EmptySet

java.lang.Object
  extended by org.opensha.sra.riskmaps.func.EmptySet
All Implemented Interfaces:
SetAPI

public class EmptySet
extends Object
implements SetAPI

This class represents the mathematical idea of an empty set. Empty sets contain no values. The union of a set with the empty set is simply the original set itself, and the intersection of a set with the empty set is again an empty set. Empty sets are neither discrete nor continuous.

 -=* CHANGE LOG *=-
 06/19/2008 -- EMM: Original implementation.

Version:
0.0.1
Author:
Eric Martinez

Constructor Summary
EmptySet()
           
 
Method Summary
 boolean contains(double x)
          Checks if the given value x exists within this set.
 boolean equals(SetAPI set)
          Checks if the calling SetAPI and the given set are logically equal.
 SetAPI intersectionOf(SetAPI set)
          Takes the intersection of the given set with the calling object.
 double lowerBound()
           
 SetAPI unionWith(SetAPI set)
          Takes the union of the given set with the calling object.
 double upperBound()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmptySet

public EmptySet()
Method Detail

contains

public boolean contains(double x)
Checks if the given value x exists within this set. Since this set is empty, the function always returns false.

Specified by:
contains in interface SetAPI
Parameters:
x - The value to check for.
Returns:
False, this set is always empty.

unionWith

public SetAPI unionWith(SetAPI set)
Takes the union of the given set with the calling object. Since this set is empty, the given set is always returned.

Specified by:
unionWith in interface SetAPI
Parameters:
set - The set to union with this set.
Returns:
A set with the same values as the passed set, namely, the passed set itself.

intersectionOf

public SetAPI intersectionOf(SetAPI set)
Takes the intersection of the given set with the calling object. Since this set is empty, the empty set is always returned.

Specified by:
intersectionOf in interface SetAPI
Parameters:
set - The set to intersect with this set.
Returns:
An empty set, namely the calling set.

equals

public boolean equals(SetAPI set)
Checks if the calling SetAPI and the given set are logically equal.

Specified by:
equals in interface SetAPI
Returns:
True if both sets are empty sets, false otherwise. Note that a continuous or discrete set containing no values is not considered an empty set.

lowerBound

public double lowerBound()
Specified by:
lowerBound in interface SetAPI
Returns:
Not a number (NaN), this set is empty.

upperBound

public double upperBound()
Specified by:
upperBound in interface SetAPI
Returns:
Not a number (NaN), this set is empty.