edu.stanford.math.plex4.streams.storage_structures
T
- the underlying basis typepublic class SortedStorageStructure<T> extends java.lang.Object implements StreamStorageStructure<T>
Constructor and Description |
---|
SortedStorageStructure(java.util.Comparator<T> basisComparator)
This construction initializes the class with a comparator for comparing the basis elements.
|
Modifier and Type | Method and Description |
---|---|
void |
addElement(T basisElement,
int filtrationIndex)
This function adds the given basis element to the storage structure, with
the supplied filtration index.
|
boolean |
containsElement(T basisElement)
This function returns true if the stream contains the given basis element,
and false otherwise.
|
void |
finalizeStructure()
This function sets the stream as being finalized.
|
java.util.Comparator<T> |
getBasisComparator()
This function returns a Comparator
|
int |
getFiltrationIndex(T basisElement)
This function returns the filtration index of the given basis element.
|
int |
getMaximumFiltrationIndex()
This function gets the maximum filtration index in the complex.
|
int |
getMinimumFiltrationIndex()
This function gets the minimum filtration index in the complex.
|
int |
getSize()
This function returns the number of elements in the storage structure.
|
boolean |
isFinalized()
This function returns true if the stream has been finalized.
|
java.util.Iterator<T> |
iterator() |
void |
removeElement(T basisElement)
This function removes the specified element form the storage structure.
|
java.lang.String |
toString() |
void |
updateOrAddElement(T basisElement,
int newFiltrationValue) |
public SortedStorageStructure(java.util.Comparator<T> basisComparator)
basisComparator
- the comparatorpublic void addElement(T basisElement, int filtrationIndex)
StreamStorageStructure
addElement
in interface StreamStorageStructure<T>
basisElement
- the basis element to addfiltrationIndex
- the filtration index of the basis elementpublic void updateOrAddElement(T basisElement, int newFiltrationValue)
public void removeElement(T basisElement)
StreamStorageStructure
removeElement
in interface StreamStorageStructure<T>
basisElement
- the basisElement to removepublic boolean isFinalized()
StreamStorageStructure
isFinalized
in interface StreamStorageStructure<T>
public void finalizeStructure()
StreamStorageStructure
finalizeStructure
in interface StreamStorageStructure<T>
public java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
public int getFiltrationIndex(T basisElement)
StreamStorageStructure
getFiltrationIndex
in interface StreamStorageStructure<T>
basisElement
- the element to querypublic java.lang.String toString()
toString
in class java.lang.Object
public java.util.Comparator<T> getBasisComparator()
StreamStorageStructure
getBasisComparator
in interface StreamStorageStructure<T>
public boolean containsElement(T basisElement)
StreamStorageStructure
containsElement
in interface StreamStorageStructure<T>
basisElement
- the basis element to querypublic int getSize()
StreamStorageStructure
getSize
in interface StreamStorageStructure<T>
public int getMaximumFiltrationIndex()
StreamStorageStructure
getMaximumFiltrationIndex
in interface StreamStorageStructure<T>
public int getMinimumFiltrationIndex()
StreamStorageStructure
getMinimumFiltrationIndex
in interface StreamStorageStructure<T>