## cascading.pipe
Class SubAssembly

    java.lang.Object
      cascading.pipe.Pipe
          cascading.pipe.SubAssembly

All Implemented Interfaces:
  FlowElement, Traceable, Serializable

Direct Known Subclasses:
  AggregateBy, Coerce, Discard, Rename, Retain, Unique

    public abstract class SubAssembly

extends Pipe

Subclasses of SubAssembly encapsulate complex assemblies of `Pipe`s so they my be reused in the same manner a Pipe is used.

That is, a typical SubAssembly subclass will accept a 'previous' Pipe instance, and a few arguments for configuring the resulting sub-assembly.

The previous pipe (or pipes) must be passed on the super constructor, or set via `setPrevious(Pipe...)`. This allows the current SubAssembly to become the parent of any Pipe instances between the previous and the tails, exclusive of the previous, and inclusive of the tails.

Subsequently all tail Pipes must be set via the `setTails(Pipe...)` method.

Note if the SubAssembly represents a split in the pipeline process, all the 'tails' of the assembly must be passed to `setTails(Pipe...)`. It is up the the developer to provide any other access to the tails so they may be chained into any subsequent Pipes.

Any `ConfigDef` values on this SubAssembly will be honored by child Pipe instances via the `Pipe.getParent()` back link described above.

See Also:
  Serialized Form

Field Summary

Fields inherited from class cascading.pipe.Pipe
`configDef, name, parent, stepConfigDef`

Constructor Summary
`protected` `SubAssembly()`
`protected` `SubAssembly(Pipe... previous)`
`protected` `SubAssembly(String name, Pipe[] previous)`

Method Summary
`String` `getName()` Get the name of this pipe.
`Pipe[]` `getPrevious()` Get all the upstream pipes this pipe is connected to.
`String[]` `getTailNames()` Method getTailNames returns the tailNames of this SubAssembly object.
`Pipe[]` `getTails()` Method getTails returns all the tails of this SubAssembly object.
`protected void` `setPrevious(Pipe... previous)` Must be called by subclasses to set the start end points of the assembly the subclass represents.
`protected void` `setTails(Pipe... tails)` Must be called by subclasses to set the final end points of the assembly the subclass represents.
`static Pipe[]` `unwind(Pipe... tails)` Is responsible for unwinding nested SubAssembly instances.

Methods inherited from class cascading.pipe.Pipe
`equals, getConfigDef, getHeads, getParent, getStepConfigDef, getTrace, hasConfigDef, hashCode, hasStepConfigDef, id, isEquivalentTo, named, names, outgoingScopeFor, pipes, print, printInternal, resolveIncomingOperationArgumentFields, resolveIncomingOperationPassThroughFields, setParent, toString`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### SubAssembly

    protected SubAssembly()

### SubAssembly

    protected SubAssembly(Pipe... previous)

### SubAssembly

    protected SubAssembly(String name,
                          Pipe[] previous)

Method Detail

### unwind

    public static Pipe[] unwind(Pipe... tails)

  Is responsible for unwinding nested SubAssembly instances.

  Parameters:
    `tails` - of type Pipe[]
  Returns:
    a Pipe[]

### setPrevious

    protected void setPrevious(Pipe... previous)

  Must be called by subclasses to set the start end points of the assembly the subclass represents.

  Parameters:
    `previous` - of type Pipe

### setTails

    protected void setTails(Pipe... tails)

  Must be called by subclasses to set the final end points of the assembly the subclass represents.

  Parameters:
    `tails` - of type Pipe

### getTails

    public Pipe[] getTails()

  Method getTails returns all the tails of this SubAssembly object. These values are set by `setTails(Pipe...)`.

  Returns:
    the tails (type Pipe[]) of this SubAssembly object.

### getTailNames

    public String[] getTailNames()

  Method getTailNames returns the tailNames of this SubAssembly object.

  Returns:
    the tailNames (type String[]) of this SubAssembly object.

### getName

    public String getName()

  Description copied from class: `Pipe`
  Get the name of this pipe. Guaranteed non-null.

  Overrides:
    `getName` in class `Pipe`
  Returns:
    String the name of this pipe

### getPrevious

    public Pipe[] getPrevious()

  Description copied from class: `Pipe`
  Get all the upstream pipes this pipe is connected to. This method will return the Pipe instances passed on the constructors as inputs to this Pipe instance.

  Overrides:
    `getPrevious` in class `Pipe`
  Returns:
    all the upstream pipes this pipe is connected to.

Copyright © 2007-2014 Concurrent, Inc. All Rights Reserved.