com.partnersoft.maps.nomenclature
Class GridLevel

java.lang.Object
  extended by com.partnersoft.maps.nomenclature.GridLevel
All Implemented Interfaces:
Coggable

public class GridLevel
extends java.lang.Object
implements Coggable

A subgridding level of a GridSystem.

Author:
Paul Reavis Copyright 1997-2001 Partner Software, Inc.

Constructor Summary
GridLevel()
          Create a new, empty GridLevel.
 
Method Summary
 int cellNumberFor(java.lang.String namePart)
          Returns the cell number for the given "name part" for this level.
 int charToNumeric(char carrie)
           
 Point convertCoordinate(int gridCoord)
          Converts a grid level coordinate (a single integer) into an x and y grid level coordinate (two integers).
 int convertCoordinate(int column, int row)
          Converts x and y grid level coordinates (two integers) into a single grid level coordinate.
 int getColumns()
          Number of columns in this subdivision.
 int getIndex()
          Integer (probably redundant) index of this level; 0 is the first subdivision; 1 is a subdivision of 0; etc.
 int getMultiplier()
          Integer to multiply a cell's name by.
 Naming getNameMapping()
           
 java.lang.String getPrefix()
          A string to stick before this level's cell name (often a dash or something similar).
 Naming getReverseNameMapping()
           
 int getRows()
          Number of rows in this subdivision.
 int getStart()
          When numbering cells, begin with this number.
 Cog getState()
           
 boolean isLowerLeft()
           
 boolean isNumeric()
          If true, use numbers to represent coordinates at this level.
 java.lang.String namePartFor(int gridCoord)
          Returns part of a textual grid name associated with the given gridCoord at this level.
 char numericToChar(int number)
           
 void setColumns(int newColumns)
           
 void setIndex(int newIndex)
           
 void setLowerLeft(boolean tizit)
           
 void setMultiplier(int newMultiplier)
           
 void setNameMapping(Naming newMapping)
          Here's where you can define a mapping of calculated name->arbitrary name for those really strangely organized grid levels.
 void setNumeric(boolean numericOrNot)
           
 void setPrefix(java.lang.String newPrefix)
           
 void setRows(int newRows)
           
 void setStart(int newStart)
           
 void setState(Cog newState)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridLevel

public GridLevel()
Create a new, empty GridLevel.

Method Detail

convertCoordinate

public Point convertCoordinate(int gridCoord)
Converts a grid level coordinate (a single integer) into an x and y grid level coordinate (two integers).


convertCoordinate

public int convertCoordinate(int column,
                             int row)
Converts x and y grid level coordinates (two integers) into a single grid level coordinate.


namePartFor

public java.lang.String namePartFor(int gridCoord)
Returns part of a textual grid name associated with the given gridCoord at this level.


cellNumberFor

public int cellNumberFor(java.lang.String namePart)
Returns the cell number for the given "name part" for this level.


charToNumeric

public int charToNumeric(char carrie)

numericToChar

public char numericToChar(int number)

getState

public Cog getState()
Specified by:
getState in interface Coggable

setState

public void setState(Cog newState)
Specified by:
setState in interface Coggable

getIndex

public int getIndex()
Integer (probably redundant) index of this level; 0 is the first subdivision; 1 is a subdivision of 0; etc.


setIndex

public void setIndex(int newIndex)

getStart

public int getStart()
When numbering cells, begin with this number.


setStart

public void setStart(int newStart)

getColumns

public int getColumns()
Number of columns in this subdivision.


setColumns

public void setColumns(int newColumns)

getRows

public int getRows()
Number of rows in this subdivision.


setRows

public void setRows(int newRows)

getPrefix

public java.lang.String getPrefix()
A string to stick before this level's cell name (often a dash or something similar).


setPrefix

public void setPrefix(java.lang.String newPrefix)

isNumeric

public boolean isNumeric()
If true, use numbers to represent coordinates at this level. If false, use alphabetics.


setNumeric

public void setNumeric(boolean numericOrNot)

getMultiplier

public int getMultiplier()
Integer to multiply a cell's name by.


setMultiplier

public void setMultiplier(int newMultiplier)

setNameMapping

public void setNameMapping(Naming newMapping)
Here's where you can define a mapping of calculated name->arbitrary name for those really strangely organized grid levels. The key for each entry must be a String with the number in it that would normally be associated with the cell, and the values should be unique. (i.e., the mapping should be one-to-one).


getNameMapping

public Naming getNameMapping()

getReverseNameMapping

public Naming getReverseNameMapping()

isLowerLeft

public boolean isLowerLeft()

setLowerLeft

public void setLowerLeft(boolean tizit)