com.facetmap.simple
Interface RefCodec

All Known Implementing Classes:
RefCodec.IdList

public interface RefCodec

Converts a set of headings (which describe a selection) to and from a string representation of the headings. The string representation is usable as output of the Selection.getRef() function.

decodeRef() and encodeRef() are inverse functions, but only to the extent that they do not change the resultant Selection. That is, if STRING_0 is a ref, and STRING_1 = encodeRef(decodeRef(STRING_0)), STRING_0 and STRING_1 may not be identical strings, but facetmap.getSelection(STRING_0) and facetmap.getSelection(STRING_1) will be equivalent. The same applies to HEADINGS and decodeRef(encodeRef(HEADINGS)) .


Nested Class Summary
static class RefCodec.IdList
          RefCodec that stores Heading IDs as serial human-readable values in the ref string.
 
Method Summary
 Heading[] decodeRef(java.lang.String refCode)
          Returns Headings that correspond to a given selection reference string.
 java.lang.String encodeRef(Heading[] headings)
          Returns a selection reference string that represents the given Headings.
 

Method Detail

decodeRef

Heading[] decodeRef(java.lang.String refCode)
                    throws UnknownReferenceException
Returns Headings that correspond to a given selection reference string.

Throws:
UnknownReferenceException

encodeRef

java.lang.String encodeRef(Heading[] headings)
Returns a selection reference string that represents the given Headings.