org.eobjects.metamodel.util
Class AlphabeticSequence

java.lang.Object
  extended by org.eobjects.metamodel.util.AlphabeticSequence

public class AlphabeticSequence
extends Object

A sequence based on alphabetic representations. Typically a sequence begin with "A", "B", "C" etc. and go from "Z" to "AA", from "AZ" to "BA" etc. This sequence is practical for generating column names that correspond to column identifiers in spreadsheets and the like.

Author:
Kasper Sørensen

Constructor Summary
AlphabeticSequence()
          Creates an alphabetic sequence that will have "A" as it's first value, if iterated using next().
AlphabeticSequence(String value)
          Creates an alphabetic sequence based on a value
 
Method Summary
 String current()
          Gets the current value (ie. doesn't iterate).
 String next()
          Iterates to the next value and returns it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlphabeticSequence

public AlphabeticSequence()
Creates an alphabetic sequence that will have "A" as it's first value, if iterated using next().


AlphabeticSequence

public AlphabeticSequence(String value)
Creates an alphabetic sequence based on a value

Parameters:
value -
Method Detail

current

public String current()
Gets the current value (ie. doesn't iterate).

Returns:
a string identifier, eg. "A", "B", "AA" etc.

next

public String next()
Iterates to the next value and returns it.

Returns:
a string identifier, eg. "A", "B", "AA" etc.


Copyright © 2007-2013. All Rights Reserved.