sub_arctic.constraints
Class std_objpart_encoding

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

public class std_objpart_encoding
extends java.lang.Object
implements std_encoding_consts

Class to provide a standard object/part encoding and to provide constants for them that can be used to build constraints. These references can denote standard parts within the local neighborhood of an object and can be used as part of lightweight constraints that use minimal storage (which are the default). These lightweight references are encoded in 6 bits: depended upon objects are encoded in 3 (high order) bits and parts use another 3 (stored in the low order bits). In addition, lightweight references store an orientation for type checking purposes.

Methods are provided for creating a new instance from an existing instance by filling in the part portion only. This allows several of these objects (i.e., PARENT) to be used as "constant factories" so we get a cleaner notation (i.e., PARENT.W()).


Field Summary
protected  int _encoding
          The encoding of the object and part for local object references and standard parts.
protected  int _orientation
          The orientation of this part.
 
Constructor Summary
std_objpart_encoding(int obj_code, int part_code, int orient_code)
          Constructor for a local reference to a standard part.
 
Method Summary
 std_objpart_encoding BOTTOM()
          Method returning an instance designating the bottom part of this object.
 std_objpart_encoding ENABLED()
          Method returning an instance designating the "enabled" part of this object
 int encoding()
          The encoding of the object and part for local object references and standard parts.
 std_objpart_encoding H()
          Method returning an instance designating the h part of this object
 std_objpart_encoding HCENTER()
          Method returning an instance designating the horizontal center part of this object
 std_objpart_encoding LEFT()
          Method returning an instance designating the left part of this object.
 int object_encoded()
          Extract and return just the object designator encoding
static int object_encoded(int enc)
          Extract and return just the object designator from the given encoding
 int orientation()
          The orientation of this part.
 std_objpart_encoding PART_A()
          Method returning an instance designating the "part_a" part of this object.
 std_objpart_encoding PART_B()
          Method returning an instance designating the "part_b" part of this object.
 int part_encoded()
          Extract and return just the part designator encoding
static int part_encoded(int enc)
          Extract and return just the part designator from the given encoding
 std_objpart_encoding RIGHT()
          Method returning an instance designating the right part of this object.
 std_objpart_encoding TOP()
          Method returning an instance designating the top part of this object.
 std_objpart_encoding VCENTER()
          Method returning an instance designating the vertical center part of this object
 std_objpart_encoding VISIBLE()
          Method returning an instance designating the "visible" part of this object
 std_objpart_encoding W()
          Method returning an instance designating the w part of this object
 std_objpart_encoding X()
          Method returning an instance designating the x part of this object
 std_objpart_encoding X1()
          Method returning an instance designating the x1 part of this object.
 std_objpart_encoding X2()
          Method returning an instance designating the x2 part of this object
 std_objpart_encoding Y()
          Method returning an instance designating the y part of this object
 std_objpart_encoding Y1()
          Method returning an instance designating the y1 part of this object.
 std_objpart_encoding Y2()
          Method returning an instance designating the y2 part of this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_encoding

protected int _encoding
The encoding of the object and part for local object references and standard parts. This is encoded in 6 bits with the high 3 being an object reference code and the low 3 being a part designator code.

_orientation

protected int _orientation
The orientation of this part. This should be one of the values: std_encoding_consts.HORIZONTAL, std_encoding_consts.VERTICAL, or std_encoding_consts.NOT_ORIENTED.
Constructor Detail

std_objpart_encoding

public std_objpart_encoding(int obj_code,
                            int part_code,
                            int orient_code)
Constructor for a local reference to a standard part.
Parameters:
int - obj_code value for object encoding. This must be between zero and OBJCODE_MAX. Values outside this range will be silently truncated.
int - part_code value for part encoding. This must be between zero and PARTCODE_MAX. Values outside this range will be silently truncated.
int - orient_code code for the orientation of this part. Should be one of HORIZONTAL, VERTICAL, or NOT_ORIENTED
Method Detail

encoding

public int encoding()
The encoding of the object and part for local object references and standard parts. This is encoded in 6 bits with the high 3 being an object reference code and the low 3 being a part designator code.

orientation

public int orientation()
The orientation of this part. This should be one of the values: std_encoding_consts.HORIZONTAL, std_encoding_consts.VERTICAL, or std_encoding_consts.NOT_ORIENTED.

object_encoded

public int object_encoded()
Extract and return just the object designator encoding

object_encoded

public static int object_encoded(int enc)
Extract and return just the object designator from the given encoding

part_encoded

public int part_encoded()
Extract and return just the part designator encoding

part_encoded

public static int part_encoded(int enc)
Extract and return just the part designator from the given encoding

X

public std_objpart_encoding X()
Method returning an instance designating the x part of this object

X1

public std_objpart_encoding X1()
Method returning an instance designating the x1 part of this object. This does exactly the same thing as X().

LEFT

public std_objpart_encoding LEFT()
Method returning an instance designating the left part of this object. This does exactly the same thing as X().

Y

public std_objpart_encoding Y()
Method returning an instance designating the y part of this object

Y1

public std_objpart_encoding Y1()
Method returning an instance designating the y1 part of this object. This does the exactly the same thing as Y().

TOP

public std_objpart_encoding TOP()
Method returning an instance designating the top part of this object. This does the exactly the same thing as Y().

X2

public std_objpart_encoding X2()
Method returning an instance designating the x2 part of this object

RIGHT

public std_objpart_encoding RIGHT()
Method returning an instance designating the right part of this object. This is the same as X2().

Y2

public std_objpart_encoding Y2()
Method returning an instance designating the y2 part of this object

BOTTOM

public std_objpart_encoding BOTTOM()
Method returning an instance designating the bottom part of this object. This is the same as Y2().

W

public std_objpart_encoding W()
Method returning an instance designating the w part of this object

H

public std_objpart_encoding H()
Method returning an instance designating the h part of this object

HCENTER

public std_objpart_encoding HCENTER()
Method returning an instance designating the horizontal center part of this object

VCENTER

public std_objpart_encoding VCENTER()
Method returning an instance designating the vertical center part of this object

VISIBLE

public std_objpart_encoding VISIBLE()
Method returning an instance designating the "visible" part of this object

ENABLED

public std_objpart_encoding ENABLED()
Method returning an instance designating the "enabled" part of this object

PART_A

public std_objpart_encoding PART_A()
Method returning an instance designating the "part_a" part of this object.

PART_B

public std_objpart_encoding PART_B()
Method returning an instance designating the "part_b" part of this object.