Class IndexedResult
java.lang.Object
org.moeaframework.analysis.series.IndexedResult
References a
ResultEntry
stored in a series, in particular providing access to the index along with methods
to iterate through the series.-
Constructor Summary
ConstructorDescriptionIndexedResult
(ResultSeries series, int index, ResultEntry entry) Constructs a new indexed result. -
Method Summary
Modifier and TypeMethodDescriptiongetEntry()
Returns the underlying result entry.int
getIndex()
Returns the index of this result in the series.Returns the population contained in this result.Returns the properties contained in this result.Returns the series containing this result.boolean
hasNext()
Returnstrue
if there exists a result following this entry in the series such that callingnext()
would succeed.boolean
Returnstrue
if there exists a result before this entry in the series such that callingprevious()
would succeed.next()
Returns the result immediately following this entry in the series.previous()
Returns the result immediately before this entry in the series.
-
Constructor Details
-
IndexedResult
Constructs a new indexed result.- Parameters:
series
- the series containing this resultindex
- the index of this result in the seriesentry
- the underlying result
-
-
Method Details
-
getSeries
Returns the series containing this result.- Returns:
- the series containing this result
-
getIndex
public int getIndex()Returns the index of this result in the series.- Returns:
- the index of this result
-
getEntry
Returns the underlying result entry.- Returns:
- the result entry
-
getPopulation
Returns the population contained in this result. This is shorthand for callinggetEntry()
.- Returns:
- the population
-
getProperties
Returns the properties contained in this result. This is shorthand for callinggetEntry()
.- Returns:
- the properties
-
hasNext
public boolean hasNext()Returnstrue
if there exists a result following this entry in the series such that callingnext()
would succeed.- Returns:
true
if there exists a result following this entry in the series;false
otherwise
-
next
Returns the result immediately following this entry in the series.- Returns:
- the next result
- Throws:
NoSuchElementException
- if at the end of the series
-
hasPrevious
public boolean hasPrevious()Returnstrue
if there exists a result before this entry in the series such that callingprevious()
would succeed.- Returns:
true
if there exists a result before this entry in the series;false
otherwise
-
previous
Returns the result immediately before this entry in the series.- Returns:
- the previous result
- Throws:
NoSuchElementException
- if at the start of the series
-