ID.java :  » Math » migen » uk » ac » lkl » migen » mockup » shapebuilder » Java Open Source

Java Open Source » Math » migen 
migen » uk » ac » lkl » migen » mockup » shapebuilder » ID.java
package uk.ac.lkl.migen.mockup.shapebuilder;

/**
 * This class provides a general ID for the whole system. This ID is a
 * combination of a name (a String) and an integer, so you can only have
 * slightly more than 4 GigaIDs.
 * 
 * @author Sergio Gutirrez (sergut at gmail.com)
 * @version 1.0
 * 
 */
public class ID {
  /**
   * The name of this ID.
   */
  String name;

  /**
   * The index of this ID.
   */
  int index;

  public ID(String myName, int myIndex) {
    name = myName;
    index = myIndex;
  }
  
  /**
   * Get the index of this ID.
   */
  public int getIndex() {
    return index;
  }

  /**
   * Get the name of this ID.
   */
  public String getName() {
    return name;
  }

  /**
   * Print a nice String that represents this ID. 
   */
  public String toString() {
    return name + index;
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.