|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Selection
Encapsulates the available navigation options as well as the current result set of Resources. A Selection is similar to a category that resources fit into -- except that, because it's a permutation of multiple Headings, it's not generally predefined as a category.
By using the forward and backward navigation logic contained in its Headings, the Selection can generate new Selections as browsing suggestions for the user.
It is possible that the Selection will provide a Heading that is not identical to the Heading provided by the source FacetSpace. That is, if
Selection selection; Heading A = selection.getHeading[0]; Heading B = selection.getFacetmap().getFacetSpace().getFacet(0).getHeading(A.getId());then it is possible for A not to be the same object as, or an object that equals, B. The Selection should deliver the data that was in the original Heading, unless, say, compilation has erased certain superficial data. More significantly, the Selection may add extra data.
The reigning example of this is: if A is the root heading of a SpectrumFacet, and the root heading did not specify a minimum and maximum, the Selection may set the minimum and maximum according to the headings actually set on the resources in the ResourceSpace. This is clearly a useful trick that requires the Facetmap's interplay between FacetSpace and ResourceSpace, and other such tricks may prove useful too, so we allow it.
The Facetmap v1 methods Selection.getContainedResources() and
Selection.getMatchedResources() (and a few similar methods)
have been removed entirely -- they don't fit in the v2 API.
getContainedResources() is now Selection's default behavior,
and you can force the behavior of getMatchedResources() by
setting property com.facetmap.Selection.omitForwardMatches during your
call to Facetmap.getSelection() .
| Method Summary | |
|---|---|
java.util.Iterator |
getBackwardSelections(Facet facet)
An Enumeration of the Selections that represent "backtracking" in navigation along the given dimension of facetspace. |
java.util.Iterator |
getBackwardSelections(int index)
An array-oriented version of getHeadings(Facet) . |
int |
getFacetCount()
|
Facetmap |
getFacetmap()
|
java.util.Iterator |
getForwardSelections(Facet facet)
An Enumeration of the Selections that are the possible "next steps" in navigation along the given dimension of facetspace. |
java.util.Iterator |
getForwardSelections(int index)
An array-oriented version of getHeadings(Facet) . |
Heading[] |
getHeadings(Facet facet)
Returns the Heading(s) of this selection in a specified facet. |
Heading[] |
getHeadings(int index)
An array-oriented version of getHeadings(Facet) . |
java.util.Properties |
getProperties()
The properties that were used in the creation of this Selection. |
java.lang.String |
getRef()
Returns a String ID (known as a reference or "ref") that uniquely identifies the Headings used to construct this Selection. |
int |
getResourceCount()
The number of Resources specified by the Headings in this Selection (regardless of any maximum specified by property com.facetmap.Selection.resultLimit). |
SelectedResourceIterator |
getResources()
Return an Iterator containing all Resources specified by this Selection, or the first N Resources specified by this Selection where N is the value of com.facetmap.Selection.resultLimit . |
boolean |
isMasterRoot()
Returns true if each of this Selection's Headings is the root Heading of its Facet. |
| Method Detail |
|---|
Facetmap getFacetmap()
int getFacetCount()
boolean isMasterRoot()
Facet.getRootHeading()java.lang.String getRef()
The reference does not contain information about the Properties used in this selection. If desired, those must be serialized separately.
Heading[] getHeadings(int index)
throws java.lang.ArrayIndexOutOfBoundsException
getHeadings(Facet) . Provide
the ordinal index number of the Facet within the FacetSpace, instead
of the Facet itself.
java.lang.ArrayIndexOutOfBoundsException
Heading[] getHeadings(Facet facet)
throws java.lang.ArrayIndexOutOfBoundsException
Note that the return value, because it is an array, can be modified. However, modifying it does not change the state of this underlying Selection. Implementors of Selection should take care that this rule is enforced.
java.lang.ArrayIndexOutOfBoundsExceptionjava.util.Properties getProperties()
Facetmap.getSelection(Heading[], Properties)
SelectedResourceIterator getResources()
throws InternalException
InternalException
int getResourceCount()
throws InternalException
This could be regarded as just a special case of getResourceWeight() , but of course it's by far the most common and we want a method that returns an int.
InternalException
java.util.Iterator getForwardSelections(Facet facet)
throws InternalException,
java.lang.ArrayIndexOutOfBoundsException
If property com.facetmap.Selection.autoSelectOnlyChild is set true, then this method may not return exactly one Selection (an "only child"). If it would ordinarily return an only child, it must return the forward selections of that child (and act recursively until the size of the result set is not one).
If property com.facetmap.Selection.showEmptySelections is set true, this method will return all possible forward Selections in the Facet, even those that contain no resources (as defined by getContainedResources). Otherwise, Selections with no contained resources must not appear in the result.
InternalException
java.lang.ArrayIndexOutOfBoundsException
java.util.Iterator getForwardSelections(int index)
throws InternalException,
java.lang.ArrayIndexOutOfBoundsException
getHeadings(Facet) . Provide
the ordinal index number of the Facet within the FacetSpace, instead
of the Facet itself.
InternalException
java.lang.ArrayIndexOutOfBoundsException
java.util.Iterator getBackwardSelections(Facet facet)
throws InternalException,
java.lang.ArrayIndexOutOfBoundsException
InternalException
java.lang.ArrayIndexOutOfBoundsExceptionFacet
java.util.Iterator getBackwardSelections(int index)
throws InternalException,
java.lang.ArrayIndexOutOfBoundsException
getHeadings(Facet) . Provide
the ordinal index number of the Facet within the FacetSpace, instead
of the Facet itself.
InternalException
java.lang.ArrayIndexOutOfBoundsException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||