org.opensha.sra.riskmaps.func
Interface SetAPI

All Known Implementing Classes:
DiscreteSet, EmptySet

public interface SetAPI

This interface defines the mathematical concept of a Set. Sets can be continuous or discrete and are defined in a number of ways. Since a Set can take on many forms, no real structure of a Set is defined here, however this does provide an API for actions that can be done on a Set.

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

Version:
0.0.1
Author:
Eric Martinez

Method Summary
 boolean contains(double x)
          Checks if a given value x exists in this set.
 boolean equals(SetAPI set)
          Checks whether the calling SetAPI and the passed set are logically equal.
 SetAPI intersectionOf(SetAPI set)
          Creates and returns a set whose values are a composite single-copy of any value appearing in both of the calling SetAPI and the passed set.
 double lowerBound()
           
 SetAPI unionWith(SetAPI set)
          Creates and returns a set whose values are a composite single-copy of any value appearing in one or both of the calling SetAPI and the passed set.
 double upperBound()
           
 

Method Detail

contains

boolean contains(double x)
Checks if a given value x exists in this set. Due to double floating point precision errors, all comparisons should take place within a reasonable tolerance for the specific set. This tolerance is left up to the implementation to determine.

Parameters:
x - The value to check for.
Returns:
True if the value exists in the set, false otherwise.

unionWith

SetAPI unionWith(SetAPI set)
Creates and returns a set whose values are a composite single-copy of any value appearing in one or both of the calling SetAPI and the passed set.

Returns:
A composite SetAPI as specified above.

intersectionOf

SetAPI intersectionOf(SetAPI set)
Creates and returns a set whose values are a composite single-copy of any value appearing in both of the calling SetAPI and the passed set.

Returns:
A composite SetAPI as specified above.

equals

boolean equals(SetAPI set)
Checks whether the calling SetAPI and the passed set are logically equal.

Returns:
True if the sets are logically equal, false otherwise.

lowerBound

double lowerBound()
Returns:
The greatest lower bound of this set. That is, the smallest number that is still in this set.

upperBound

double upperBound()
Returns:
The least upper bound of this set. That is, the largest number that is still in this set.