Orbital library

orbital.logic
Interface Composite

All Known Subinterfaces:
BinaryFunction.Composite, BinaryFunction.Composite, BinaryPredicate.Composite, Expression.Composite, Formula.Composite, Function.Composite, Function.Composite, Functor.Composite, MathFunctor.Composite, Predicate.Composite, Type.Composite, VoidFunction.Composite, VoidPredicate.Composite

public interface Composite

The base interface for all things that are composed of other things. Such compositions include but are not limited to functors, expressions, and types.

Explicit composition information alas to this interface is required in several situations that have a structurally inductive effect. Like when they need to structurally decompose objects in order to define substitution, unification, matching formatting, derivation, general transformations, etc.

Author:
André Platzer
See Also:
(unidirectional and multiple) Composite Pattern
Structure:
aggregate compositor:Object, aggregate component:Object

Method Summary
 Composite construct(java.lang.Object compositor, java.lang.Object component)
          Construct a new composition with the given parameters, of the same type like this.
 java.lang.Object getComponent()
          Get the inner component.
 java.lang.Object getCompositor()
          Get the outer compositor.
 void setComponent(java.lang.Object component)
          Set the inner component.
 void setCompositor(java.lang.Object compositor)
          Set the outer compositor.
 

Method Detail

getCompositor

java.lang.Object getCompositor()
Get the outer compositor.

Returns:
the outer compositor f that operates on the results of the inner component.

getComponent

java.lang.Object getComponent()
Get the inner component.

Returns:
the inner component object g, or an array of the inner components {g1,...gk}T. Multi-dimensional component arrays and alike are permitted, as well.

construct

Composite construct(java.lang.Object compositor,
                    java.lang.Object component)
                    throws java.lang.IllegalArgumentException,
                           java.lang.ClassCastException
Construct a new composition with the given parameters, of the same type like this.

Parameters:
compositor - the outer compositor f that operates on the results of the inner component.
component - the inner component object g, or an array of the inner components {g1,...gk}T. Multi-dimensional component arrays and alike are permitted, as well.
Returns:
a composite object f(g) of the same type as this, with compositor and component as specified.
Throws:
java.lang.IllegalArgumentException - if f is an illegal compositor or g is an illegal component for this kind of composite object. Depending upon context, this method may also throw ClassCastException, instead.
java.lang.ClassCastException - if f has the wrong type for a compositor, or g the wrong type for a component. Depending upon context, this method may also throw IllegalArgumentException, instead.
java.lang.UnsupportedOperationException - if this method does not support modification cloning.
See Also:
Factory Method, Object.clone()
Postconditions:
RES != RES ∧ RES.getClass()==getClass() ∧ RES.getCompositor()==f ∧ RES.getComponent()==g

setCompositor

void setCompositor(java.lang.Object compositor)
                   throws java.lang.IllegalArgumentException,
                          java.lang.ClassCastException
Set the outer compositor.

Parameters:
compositor - the outer compositor f that operates on the results of the inner component.
Throws:
java.lang.IllegalArgumentException - if compositor is an illegal compositor for this composite object. Depending upon context, this method may also throw ClassCastException, instead.
java.lang.ClassCastException - if compositor has the wrong type for a compositor. Depending upon context, this method may also throw IllegalArgumentException, instead.
java.lang.UnsupportedOperationException - if this method is not supported by this object, or this object is immutable.

setComponent

void setComponent(java.lang.Object component)
                  throws java.lang.IllegalArgumentException,
                         java.lang.ClassCastException
Set the inner component.

Parameters:
component - the inner component object g, or an array of the inner components {g1,...gk}T. Multi-dimensional component arrays and alike are permitted, as well.
Throws:
java.lang.IllegalArgumentException - if g is an illegal component for this composite object. Depending upon context, this method may also throw ClassCastException, instead.
java.lang.ClassCastException - if g has the wrong type for a component. Depending upon context, this method may also throw IllegalArgumentException, instead.
java.lang.UnsupportedOperationException - if this method is not supported by this object, or this object is immutable.

Orbital library
1.3.0: 11 Apr 2009

Copyright © 1996-2009 André Platzer
All Rights Reserved.