Package oracle.spatial.geometry
Class Union
- java.lang.Object
-
- oracle.spatial.geometry.Union
-
public class Union extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Union(int K)
Constructor: Initialize an empty Union data struct with K Sets/Components indexed 0 to K-1.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
areSitesConnected(int s, int r)
This method determines whether the Set/Component containing Site/Element "s" is the same as the Set/Component containing Site/Element "r".int
countElements()
Returns the number of Sites/Elements (i.e., size of id Array).int
countSets()
Returns the number of Sets/Components.int
findSetIdentifier(int item)
Returns the Set/Component Identifier in id Array for the Set/Component containing the Site/Element "s".java.util.ArrayList
getAllSetIdentifiersforParents()
This method returns the Set/Component Identifiers for Parent Sites/Elements.static void
main(java.lang.String[] args)
void
unionSets(int s, int r)
This method merges the Set/Component containing Site/Element "s" with the Set/Component containing the Site/Element "r".
-
-
-
Method Detail
-
findSetIdentifier
public int findSetIdentifier(int item)
Returns the Set/Component Identifier in id Array for the Set/Component containing the Site/Element "s".- Parameters:
item
- the integer which represents the Site/Element- Returns:
- the Set/Component Identifier in id Array for the Set/Component containing the Site/Element "s".
-
countSets
public int countSets()
Returns the number of Sets/Components.- Returns:
- the number of Sets/Components.
-
countElements
public int countElements()
Returns the number of Sites/Elements (i.e., size of id Array).- Returns:
- the number of Sites/Elements.
-
unionSets
public void unionSets(int s, int r)
This method merges the Set/Component containing Site/Element "s" with the Set/Component containing the Site/Element "r".- Parameters:
s
- the integer value for first Site/Elementr
- the integer value for second Site/Element
-
areSitesConnected
public boolean areSitesConnected(int s, int r)
This method determines whether the Set/Component containing Site/Element "s" is the same as the Set/Component containing Site/Element "r". In other words, it tells whether both Sites/Elements are in the same Set/Component.- Parameters:
s
- the integer value for first Site/Elementr
- the integer value for second Site/Element
-
getAllSetIdentifiersforParents
public java.util.ArrayList getAllSetIdentifiersforParents()
This method returns the Set/Component Identifiers for Parent Sites/Elements. As an application: For a valid Simple Solid Geometry: there should be exactly 1 element in the returned ArrayList.- Returns:
- an ArrayList containing the Set/Component Identifiers for Parent Sites/Elements.
-
main
public static void main(java.lang.String[] args)
-
-