com.partnersoft.maps.rover
Class RoverBlock<T extends RoverShape>

java.lang.Object
  extended by com.partnersoft.maps.rover.RoverBlock<T>
All Implemented Interfaces:
Immutable, java.lang.Iterable<T>

public class RoverBlock<T extends RoverShape>
extends java.lang.Object
implements Immutable, java.lang.Iterable<T>

A block of similar shapes.

In Rover binary formats, shapes are generally grouped into blocks with the same class and drawId and similar parameters. This class models those blocks.

Copyright 2009 Partner Software, Inc.

Version:
$Id$
Author:
Paul Reavis

Constructor Summary
RoverBlock(int dataId, T... shapes)
          Creates a block from the given dataId and shapes.
RoverBlock(RoverBlockHeader header, java.util.List<T> shapes)
          Creates a block from the given header and shapes.
RoverBlock(RoverBlockHeader header, T... shapes)
          Creates a block from the given header and shapes.
RoverBlock(T shape)
          Creates a block from the given shape, setting up the header correctly based on shape parameters.
 
Method Summary
 RoverBlockHeader getHeader()
           
 java.util.Iterator<T> iterator()
           
 java.util.List<T> listShapes()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoverBlock

public RoverBlock(int dataId,
                  T... shapes)
Creates a block from the given dataId and shapes. It ensures that all shapes have the given dataId set, and sets up the header correctly based on the shape parameters.


RoverBlock

public RoverBlock(T shape)
Creates a block from the given shape, setting up the header correctly based on shape parameters.

Parameters:
shape -

RoverBlock

public RoverBlock(RoverBlockHeader header,
                  T... shapes)
Creates a block from the given header and shapes. Double-checks the shapes to ensure their parameters match the header.

Parameters:
header -
shapes -

RoverBlock

public RoverBlock(RoverBlockHeader header,
                  java.util.List<T> shapes)
Creates a block from the given header and shapes. Double-checks the shapes to ensure their parameters match the header.

Parameters:
header -
shapes -
Method Detail

getHeader

public RoverBlockHeader getHeader()

listShapes

public java.util.List<T> listShapes()

iterator

public java.util.Iterator<T> iterator()
Specified by:
iterator in interface java.lang.Iterable<T extends RoverShape>