|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.facetmap.simple.SelectionData
A class intended for storage of Selection state. There's very little logic in here; it just accepts data and spits it out on request. It will do a bit of dynamic allocation when you set its facetmap, and it does have a rudimentary system to encode and decode its own ref.
Consider adding an equals() implementation and other basics.
| Field Summary | |
int |
facetCount
|
Map |
facetmap
|
Heading[] |
headings
|
static java.lang.String |
REF_DELIM
|
int |
resultCount
|
int |
resultLimit
|
java.util.ArrayList |
results
|
java.util.List |
subsets
List of Vectors of Selections, one Collection per facet |
java.util.List |
supersets
List of Vectors of Selections, one Collection per facet |
| Constructor Summary | |
SelectionData()
Construct a SelectionData with no state defined at all. |
|
SelectionData(Map facetmap)
Create a SelectionData with default or null values. |
|
| Method Summary | |
boolean |
containsAnyResources()
|
void |
decodeRef(java.lang.String refCode)
Sets the Headings of this Selection according to the given ref. |
java.util.Enumeration |
getBackwardSelections(int index)
An Enumeration of the Selections that represent "backtracking" in navigation along the given dimension of facetspace. |
int |
getContainedResourceCount()
|
Resource[] |
getContainedResources()
This selection's result set should never exceed the limit specified by resultLimit. |
int |
getDimensionCount()
|
java.util.Enumeration |
getForwardSelections(int index)
An Enumeration of the Selections that are the possible "next steps" in navigation along the given dimension of facetspace. |
Heading |
getHeading(int index)
Returns the Heading along the given dimension of facetspace. |
Map |
getMap()
|
int |
getMatchedResourceCount()
|
Resource[] |
getMatchedResources()
If each of a Resource's Headings match this Selection's Headings, then that Resource is included in the returned array. |
java.lang.String |
getRef()
Returns a String ID (known as a reference or "ref") that uniquely identifies this Selection. |
java.util.Collection |
getSubset(int facetIndex)
|
java.util.Collection |
getSuperset(int facetIndex)
|
boolean |
isMasterRoot()
Returns true if each of this Selection's Headings is the Root of its Facet. |
boolean |
matchesAnyResources()
|
void |
setHeading(Heading heading)
Sets the given Heading as a Heading of this Selection. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String REF_DELIM
public int facetCount
public Heading[] headings
public java.util.List supersets
public java.util.List subsets
public int resultCount
public int resultLimit
public java.util.ArrayList results
public Map facetmap
| Constructor Detail |
public SelectionData()
public SelectionData(Map facetmap)
| Method Detail |
public java.util.Collection getSuperset(int facetIndex)
public java.util.Collection getSubset(int facetIndex)
public Heading getHeading(int index)
throws java.lang.ArrayIndexOutOfBoundsException
getHeading in interface Selectionjava.lang.ArrayIndexOutOfBoundsExceptionpublic Map getMap()
getMap in interface Selectionpublic int getDimensionCount()
getDimensionCount in interface Selection
public void setHeading(Heading heading)
throws java.lang.IllegalArgumentException
setHeading in interface Selectionjava.lang.IllegalArgumentExceptionpublic boolean isMasterRoot()
isMasterRoot in interface SelectionFacet#getRootHeadingpublic java.lang.String getRef()
getRef in interface Selection
public void decodeRef(java.lang.String refCode)
throws UnknownReferenceException
decodeRef in interface SelectionUnknownReferenceException
public int getMatchedResourceCount()
throws InternalException
getMatchedResourceCount in interface SelectionInternalException
public int getContainedResourceCount()
throws InternalException
getContainedResourceCount in interface SelectionInternalException
public boolean containsAnyResources()
throws InternalException
containsAnyResources in interface SelectionInternalException
public boolean matchesAnyResources()
throws InternalException
matchesAnyResources in interface SelectionInternalException
public java.util.Enumeration getForwardSelections(int index)
throws InternalException,
java.lang.ArrayIndexOutOfBoundsException
SelectionIf autoSelectOnlyChild is set true on this Selection's Map, 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 showEmptySelections is set true on this Selection's Map, this method will return all possible forward Selections, even those that contain no resources (as defined by getContainedResources). Otherwise, Selections with no contained resources must not appear in the result.
getForwardSelections in interface SelectionInternalException
java.lang.ArrayIndexOutOfBoundsExceptionMap.setAutoSelectOnlyChild(boolean),
Map.setShowEmptySelections(boolean)
public java.util.Enumeration getBackwardSelections(int index)
throws InternalException,
java.lang.ArrayIndexOutOfBoundsException
Selection
getBackwardSelections in interface SelectionInternalException
java.lang.ArrayIndexOutOfBoundsExceptionFacet
public Resource[] getMatchedResources()
throws InternalException
Selection
getMatchedResources in interface SelectionInternalException
public Resource[] getContainedResources()
throws InternalException
getContainedResources in interface SelectionInternalException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||