Prism.util
Class Address

java.lang.Object
  |
  +--Prism.util.Address
All Implemented Interfaces:
Prism.util.AddressConstants

public class Address
extends java.lang.Object
implements Prism.util.AddressConstants

The Address class can handle the assigned multi-digit address that is used to identify the object It provides an implementation independent way of defining the id of an object.


Field Summary
static int BASE_256
          Base 256 addressing as used in IP
static char DOT
          The character period
static int IP_STYLE
          An IP Styled address in the form of x.x.x.x
 
Constructor Summary
Address(long newId)
          Constructor used only by the Address class to create a range of addresses
Address(java.lang.String address)
          Create an address based on a string representation of the address
 
Method Summary
 boolean equals(Address another)
          Compare the address given to the address of this object
 boolean equals(long num)
           
 long getNumeric()
           
static void main(java.lang.String[] args)
           
 Address nextAddress()
           
 Address prevAddress()
           
 java.lang.String toString()
          Convert the address to a stringified version
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IP_STYLE

public static final int IP_STYLE
An IP Styled address in the form of x.x.x.x

BASE_256

public static final int BASE_256
Base 256 addressing as used in IP

DOT

public static final char DOT
The character period
Constructor Detail

Address

public Address(java.lang.String address)
Create an address based on a string representation of the address
Parameters:
address - String representation of the address

Address

public Address(long newId)
Constructor used only by the Address class to create a range of addresses
Method Detail

toString

public java.lang.String toString()
Convert the address to a stringified version
Overrides:
toString in class java.lang.Object
Returns:
String the stringified address

equals

public boolean equals(Address another)
Compare the address given to the address of this object
Parameters:
another - the object to be compared to
Returns:
boolean whether the objects have the same address

nextAddress

public Address nextAddress()

prevAddress

public Address prevAddress()

main

public static void main(java.lang.String[] args)

getNumeric

public long getNumeric()

equals

public boolean equals(long num)