Biomedical Engineering Reference
In-Depth Information
sets operations (see Tables 7.2 , 7.3 and 7.4 ). We have given the following snap
shot of sets operations, which are by default generated in every source code of
Java file.
public static <T> Set<T>
unionSet ( Set <T> setA ,
Set <T>
setB )
{
Set <T> tmp = new
HashSet <T>( setA ) ;
tmp . addAll ( setB );
return
tmp;
}
public static <T> Set<T>
intersectionSet (Set<T> setA ,
Set<T> setB)
{
Set <T> tmp = new HashSet <T>( setA ) ;
tmp. retainAll (setB );
return
tmp;
}
public static <T> Set<T>
differenceSet (Set<T> setA ,
Set<T> setB)
{
Set <T> tmp = new HashSet <T>( setA ) ;
tmp . removeAll ( setB ) ;
return
tmp;
}
public st at i c <T> boolean
isSubset (Set<T> setA ,
Set<T> setB )
{
return
setB . containsAll (setA );
}
public st at i c <T> boolean
isEqualSet (Set<T> setA ,
Set<T> setB )
{
return
( setB . containsAll (setA)&& setA . containsAll ( setB ));
}
...
Set Definition : To define a set type into C++, Java and C#, the translation tool
uses some fixed code structures to define a sets type with the help of STL library,
Java utilities and .NET Framework (when set type is unknown). The following
structures are excerpted from a translated code to understand the set definition of
a context model:
In the C++ language ...
c l a s s DATASet{
private :
string
element ;
Search WWH ::




Custom Search