MOEA Framework 2.12
API Specification

org.moeaframework.analysis.collector
Class AttachPoint

java.lang.Object
  extended by org.moeaframework.analysis.collector.AttachPoint

public abstract class AttachPoint
extends Object

Identifies objects in an object graph (all public and private fields contained within an object and those it references). For instance,

   AttachPoint.isClass(TypeA.class).and(AttachPoint.isNestedIn(TypeB.class)
 
will match any objects of type TypeA that are referenced (or accessible through) an object of type TypeB.


Constructor Summary
protected AttachPoint()
          Protected constructor to prevent instantiation, but allow subclassing.
 
Method Summary
 AttachPoint and(AttachPoint that)
          Returns an attach point which performs the logical AND between two attach points, matching an object only if both attach points match the object.
static AttachPoint isClass(Class<?> type)
          Returns an attach point that matches an object if its type is equal to the specified type.
static AttachPoint isDeclaredIn(Class<?> parentType)
          Returns an attach point that matches an object if it is a declared field of the specified type.
static AttachPoint isNestedIn(Class<?> ancestorType)
          Returns an attach point that matches an object if it is nested inside a class of the specified type.
static AttachPoint isSubclass(Class<?> type)
          Returns an attach point that matches an object if it is an instance of the specified type.
abstract  boolean matches(Stack<Object> parents, Object object)
          Returns true if the specified object in the object graph matches some criteria; and false otherwise.
static AttachPoint not(AttachPoint that)
          Returns an attach point which performs the logical NOT on the given attach point, matching an object only if the attach point does not match the object.
 AttachPoint or(AttachPoint that)
          Returns an attach point which performs the logical OR between two attach points, matching an object if either or both of the attach points match the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttachPoint

protected AttachPoint()
Protected constructor to prevent instantiation, but allow subclassing.

Method Detail

and

public AttachPoint and(AttachPoint that)
Returns an attach point which performs the logical AND between two attach points, matching an object only if both attach points match the object.

Parameters:
that - the second attach point
Returns:
an attach point which performs the logical AND between two attach points

or

public AttachPoint or(AttachPoint that)
Returns an attach point which performs the logical OR between two attach points, matching an object if either or both of the attach points match the object.

Parameters:
that - the second attach point
Returns:
an attach point which performs the logical OR between two attach points

not

public static AttachPoint not(AttachPoint that)
Returns an attach point which performs the logical NOT on the given attach point, matching an object only if the attach point does not match the object.

Parameters:
that - the original attach point
Returns:
an attach point which performs the logical NOT on the given attach point

isClass

public static AttachPoint isClass(Class<?> type)
Returns an attach point that matches an object if its type is equal to the specified type. Note that subclasses of the type will not match.

Parameters:
type - the required type of the object
Returns:
an attach point that matches an object if its type is equal to the specified type

isSubclass

public static AttachPoint isSubclass(Class<?> type)
Returns an attach point that matches an object if it is an instance of the specified type. The specified type and all subclasses will match.

Parameters:
type - the required type/supertype of the object
Returns:
an attach point that matches an object if it is an instance of the specified type

isDeclaredIn

public static AttachPoint isDeclaredIn(Class<?> parentType)
Returns an attach point that matches an object if it is a declared field of the specified type.

Parameters:
parentType - the parent type
Returns:
an attach point that matches an object if it is a declared field of the specified type

isNestedIn

public static AttachPoint isNestedIn(Class<?> ancestorType)
Returns an attach point that matches an object if it is nested inside a class of the specified type. This includes both declared fields of the specified type and all fields accessible by recursively following all references.

Parameters:
ancestorType - the ancestor type
Returns:
an attach point that matches an object if it is nested inside a class of the specified type

matches

public abstract boolean matches(Stack<Object> parents,
                                Object object)
Returns true if the specified object in the object graph matches some criteria; and false otherwise.

Parameters:
parents - the path from the root (starting) object to the current object
object - the current object
Returns:
true if the specified object in the object graph matches some criteria; and false otherwise

MOEA Framework 2.12
API Specification

Copyright 2009-2016 MOEA Framework. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage. Visit us on Github!