sub_arctic.constraints
Class std_constraint

java.lang.Object
  |
  +--sub_arctic.constraints.std_constraint

public class std_constraint
extends java.lang.Object
implements constraint

Base class for objects that represent standard lightweight constraints. Here we store the integer encoding as well as the orientation of the constraint and a reference to the constraint_impl object that understands the encoding.


Field Summary
protected  int _encoding
          Encoding of constraint as an integer.
protected  constraint_impl _impl
          The implementation object for this constraint.
protected  int _orientation
          Orientation of the constraint.
 
Constructor Summary
std_constraint(int encode_val, constraint_impl imp, int orient)
          Full constructor.
std_constraint(int encode_val, int orient)
          Constructor defaulting to the standard constraint implementation.
 
Method Summary
 int encoding()
          Encoding of constraint as an integer.
 constraint_impl impl()
          The implementation object for this constraint.
 boolean is_external()
          Indicate if this constraint is encoding for an external constraint.
 boolean is_none()
          Indicate if this constraint is actually encoding for no constraint.
 int orientation()
          Orientation of the constraint.
 java.lang.String tag()
          Create a terse human readable string describing the constraint.
 java.lang.String toString()
          Create a human readable string describing the constraint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_encoding

protected int _encoding
Encoding of constraint as an integer.

_impl

protected constraint_impl _impl
The implementation object for this constraint.

_orientation

protected int _orientation
Orientation of the constraint. This is a bitset made up of any of: std_encoding_consts.HORIZONTAL, std_encoding_consts.VERTICAL, and/or std_encoding_consts.NOT_ORIENTED.
Constructor Detail

std_constraint

public std_constraint(int encode_val,
                      constraint_impl imp,
                      int orient)
Full constructor.

Parameters:
int - encode_val the encoding for this constraint.
constraint_impl - imp the implementation object that understands the encoding above.
int - orient the orientation of the constraint (one or more bits from std_encoding_consts.HORIZONTAL, std_encoding_consts.VERTICAL, and/or std_encoding_consts.NOT_ORIENTED).

std_constraint

public std_constraint(int encode_val,
                      int orient)
Constructor defaulting to the standard constraint implementation.

Parameters:
int - encode_val the encoding for this constraint.
int - orient the orientation of the constraint (one or more bits from std_encoding_consts.HORIZONTAL, std_encoding_consts.VERTICAL, and/or std_encoding_consts.NOT_ORIENTED).
Method Detail

encoding

public int encoding()
Encoding of constraint as an integer.
Specified by:
encoding in interface constraint

impl

public constraint_impl impl()
The implementation object for this constraint.
Specified by:
impl in interface constraint

orientation

public int orientation()
Orientation of the constraint. This is a bitset made up of any of: std_encoding_consts.HORIZONTAL, std_encoding_consts.VERTICAL, and/or std_encoding_consts.NOT_ORIENTED.
Specified by:
orientation in interface constraint

toString

public java.lang.String toString()
Create a human readable string describing the constraint.
Specified by:
toString in interface constraint
Overrides:
toString in class java.lang.Object

tag

public java.lang.String tag()
Create a terse human readable string describing the constraint.
Specified by:
tag in interface constraint

is_none

public boolean is_none()
Indicate if this constraint is actually encoding for no constraint.
Specified by:
is_none in interface constraint

is_external

public boolean is_external()
Indicate if this constraint is encoding for an external constraint.
Specified by:
is_external in interface constraint