com.sun.multicast.allocation
Class ScopeList

java.lang.Object
  |
  +--com.sun.multicast.allocation.ScopeList
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class ScopeList
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

A multicast scope list.

Objects of this class and all values returned by their methods are immutable. That is, their values cannot change after they are constructed.

See Also:
Serialized Form

Constructor Summary
ScopeList()
          Creates an empty ScopeList.
ScopeList(java.util.Enumeration scopes)
          Creates a ScopeList with the specified parameters.
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares this ScopeList with the specified object for order.
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 Scope findScopeForTTL(int ttl)
          Finds a Scope suitable for use with the specified ttl value.
 java.util.Enumeration getScopes()
          Gets an Enumeration of the scopes in this list.
 int hashCode()
          Returns a hash code value for this object.
 java.lang.String toString()
          Returns a string representation of this ScopeList.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScopeList

public ScopeList()
Creates an empty ScopeList.

ScopeList

public ScopeList(java.util.Enumeration scopes)
Creates a ScopeList with the specified parameters.
Parameters:
scopes - an Enumeration of Scopes to be included
Method Detail

getScopes

public java.util.Enumeration getScopes()
Gets an Enumeration of the scopes in this list.
Returns:
an Enumeration of Scopes

compareTo

public int compareTo(java.lang.Object o)
              throws java.lang.ClassCastException
Compares this ScopeList with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

If the other object is not a ScopeList, a ClassCastException is thrown.

This method imposes a total ordering on ScopeLists. ScopeLists are ordered according to the order of the Scopes contained within them.

Parameters:
o - the Object to compare against
Returns:
an integer reflecting the outcome of the comparison
Throws:
java.lang.ClassCastException - if the objects cannot be compared

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one. Two ScopeLists are equal if and only the Scopes in the ScopeLists are all equal.
Overrides:
equals in class java.lang.Object
Parameters:
obj - the object with which to compare
Returns:
true if this object is the same as the reference object, false otherwise.

hashCode

public int hashCode()
Returns a hash code value for this object. The hash code values for two ScopeLists are equal if they are equal. However, it may be possible for two unequal ScopeLists to have the same hash code.
Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this ScopeList

findScopeForTTL

public Scope findScopeForTTL(int ttl)
Finds a Scope suitable for use with the specified ttl value.
Returns:
a Scope suitable for use with the specified ttl value (null if none available)

toString

public java.lang.String toString()
Returns a string representation of this ScopeList.
Overrides:
toString in class java.lang.Object
Returns:
a string representation of this ScopeList


JavaTM Reliable MulticastTM Service version 1.1
Copyright (c) 2001, Sun Microsystems Laboratories, All rights reserved.