com.partnersoft.maps.rover
Class RoverBlockCode

java.lang.Object
  extended by com.partnersoft.maps.rover.RoverBlockCode
All Implemented Interfaces:
Immutable

public class RoverBlockCode
extends java.lang.Object
implements Immutable

A one-byte code representing the format and type of RoverShapes in a block section of a rover binary.

This is a wrapper to provide an easy and standard way to interpret the flags.

The layout is as follows, reading from right (low bit 0) to left (high bit 7)

Nonstandard or legacy rover binary formats may use a different byte representation; in those cases this is simply a data structure and not a required format.

Copyright 2008-2009 Partner Software, Inc.

Version:
$Id$
Author:
Paul Reavis

Constructor Summary
RoverBlockCode(int code)
          Creates a RoverBlockCode
RoverBlockCode(RoverShapeType type, boolean hasData, boolean hasZ, boolean hasRotations, boolean hasOffsets)
           
 
Method Summary
 byte getCode()
           
 RoverShapeType getShapeType()
           
 int getShapeTypeCode()
           
 boolean hasData()
          Returns true if the block has data.
 boolean hasOffsets()
          Returns true if the block has shapes with offsets.
 boolean hasRotations()
          Returns true if the block has shapes with rotations.
 boolean hasZ()
          Returns true if the block has data.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RoverBlockCode

public RoverBlockCode(int code)
Creates a RoverBlockCode


RoverBlockCode

public RoverBlockCode(RoverShapeType type,
                      boolean hasData,
                      boolean hasZ,
                      boolean hasRotations,
                      boolean hasOffsets)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getCode

public byte getCode()

getShapeTypeCode

public int getShapeTypeCode()

getShapeType

public RoverShapeType getShapeType()

hasData

public boolean hasData()
Returns true if the block has data.


hasZ

public boolean hasZ()
Returns true if the block has data.


hasRotations

public boolean hasRotations()
Returns true if the block has shapes with rotations.


hasOffsets

public boolean hasOffsets()
Returns true if the block has shapes with offsets.