facets.core.app
Class PathSelection

java.lang.Object
  extended by facets.core.app.PathSelection
All Implemented Interfaces:
SSelection, java.io.Serializable

public final class PathSelection
extends java.lang.Object
implements SSelection

Implements SSelection using OffsetPaths.

The immutable paths members of PathSelection should describe paths rooted on content().

See Also:
Serialized Form

Field Summary
 OffsetPath[] paths
          The OffsetPaths passed to the constructor and rooted on content().
 
Constructor Summary
PathSelection(java.lang.Object content, OffsetPath... paths)
          Core constructor.
 
Method Summary
 java.lang.Object content()
          The content within which to select.
static PathSelection newMinimal(java.lang.Object content)
          Creates a selection with a single, single-membered path.
static PathSelection newSingle(java.lang.Object content, OffsetPath path)
          Creates a selection with a single path.
static java.lang.Object[] pathMembers(PathSelection selection, int pathAt)
           
static PathSelection procrust(PathSelection src, java.lang.Object to)
           
 java.lang.Object selection()
          Implements interface method.
 java.lang.Object[] selections()
          Implements interface method.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

paths

public final OffsetPath[] paths
The OffsetPaths passed to the constructor and rooted on content().

Constructor Detail

PathSelection

public PathSelection(java.lang.Object content,
                     OffsetPath... paths)
Core constructor.

Parameters:
paths - set as paths; they be rooted on content, which is returned as content()
Method Detail

newMinimal

public static PathSelection newMinimal(java.lang.Object content)
Creates a selection with a single, single-membered path.

Parameters:
content - is passed to newSingle(Object, OffsetPath) together with OffsetPath.singleMembered

newSingle

public static PathSelection newSingle(java.lang.Object content,
                                      OffsetPath path)
Creates a selection with a single path.

Content is passed to PathSelection(Object,OffsetPath[]) together with an OffsetPath[] containing path


procrust

public static PathSelection procrust(PathSelection src,
                                     java.lang.Object to)

pathMembers

public static java.lang.Object[] pathMembers(PathSelection selection,
                                             int pathAt)

selections

public final java.lang.Object[] selections()
Implements interface method.

Specified by:
selections in interface SSelection
Returns:
the OffsetPath.target(Object)s of paths

selection

public final java.lang.Object selection()
Implements interface method.

Specified by:
selection in interface SSelection
Returns:
the first member of selections()

content

public final java.lang.Object content()
Description copied from interface: SSelection
The content within which to select.

This will generally be the content to display within a viewer; and thus itself a portion of some larger content.

Specified by:
content in interface SSelection

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object