JNodeOS v1.2.0 API

edu.utah.janos.nodeos
Class Address

java.lang.Object
  |
  +--edu.utah.janos.nodeos.Address

public class Address
extends java.lang.Object
implements edu.utah.janosvm.kit.comm.commspace.CommSpaceable

An address object hides the details and implementation of addressing in Janos. Addresses can only be created through an AddressFactory.

An Address has two parts a logical "active network" address and an underlying "physical address". The physical address in this implementation of Address is the combination of a protocol specification and an address specification; This is similar to what is described in the NodeOS specification for addressing.

The "active address" is a 32-bit IP-like number.

Address objects are immutable. They must be immutable because anyone(?) can read them out of routing tables...

Author:
Janos Ministry of Development

Method Summary
 java.lang.Object clone()
           
 java.lang.Object deepCopy()
          Deep copy to be performed when this is pulled out of a CommSpaceElement
 boolean equals(java.lang.Object obj)
           
static int fromString(java.lang.String name)
          Generate a 32-bit integer from the given string address.
static AddressFactory getAddressFactory()
          Get the global AddressFactory.
 java.lang.String getAddressSpec()
           
 int getANAddress()
           
 java.lang.String getProtocolSpec()
           
 int hashCode()
           
 java.lang.String toString()
           
static java.lang.String toString(int a)
          Generate a string representation of the given 32-bit integer address.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getAddressFactory

public static AddressFactory getAddressFactory()
Get the global AddressFactory. Note that access to the AddressFactory should only be given to trusted code.

getANAddress

public int getANAddress()

getProtocolSpec

public java.lang.String getProtocolSpec()

getAddressSpec

public java.lang.String getAddressSpec()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

deepCopy

public java.lang.Object deepCopy()
Deep copy to be performed when this is pulled out of a CommSpaceElement

This appears due to the CommSpaceable interface

Specified by:
deepCopy in interface edu.utah.janosvm.kit.comm.commspace.CommSpaceable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public static java.lang.String toString(int a)
Generate a string representation of the given 32-bit integer address. Generates standard dotted-quad notation.

fromString

public static int fromString(java.lang.String name)
                      throws AddressFormatException
Generate a 32-bit integer from the given string address. The string must be a dotted-quad, e.g. "192.168.1.2".
Parameters:
name - A dotted-quad string address
Returns:
the 32-bit integer represented by name
Throws:
AddressFormatException - if there aren't 4 parts, any of the 4 parts don't parse, or are out of range.

JNodeOS v1.2.0 API

This documentation is Copyright (C) 1998-2002 The University of Utah. All Rights Reserved. See the file LICENSE for distribution terms.
Documentation, software, and mailing list archives for Janos can be found at the Janos Project web site: http://www.cs.utah.edu/flux/janos/
Generated on Mar 17, 2002