org.xins.common.service
Class Descriptor

java.lang.Object
  extended byorg.xins.common.service.Descriptor
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
GroupDescriptor, TargetDescriptor

public abstract class Descriptor
extends Object
implements Serializable

Descriptor for a service or group of services.

Since:
XINS 1.0.0
Version:
$Revision: 1.15 $ $Date: 2006/10/25 11:20:57 $
Author:
Ernst de Haan
See Also:
Serialized Form

Method Summary
abstract  TargetDescriptor getTargetByCRC(int crc)
          Returns the TargetDescriptor that matches the specified CRC-32 checksum.
abstract  int getTargetCount()
          Counts the total number of target descriptors in/under this descriptor.
abstract  boolean isGroup()
          Checks if this descriptor denotes a group of descriptor of descriptorss.
abstract  Iterator iterateTargets()
          Iterates over all leaves, the target descriptors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isGroup

public abstract boolean isGroup()
Checks if this descriptor denotes a group of descriptor of descriptorss.

Returns:
true if this descriptor denotes a group, false otherwise.

iterateTargets

public abstract Iterator iterateTargets()
Iterates over all leaves, the target descriptors.

The returned Iterator will not support Iterator.remove(). The iterator will only return TargetDescriptor instances, no instances of other classes and no null values.

Also, this iterator is guaranteed to return getTargetCount() instances of class TargetDescriptor.

Returns:
iterator over the leaves, the target descriptors, in this descriptor, in the correct order, never null.

getTargetCount

public abstract int getTargetCount()
Counts the total number of target descriptors in/under this descriptor.

Returns:
the total number of target descriptors, always >= 1.

getTargetByCRC

public abstract TargetDescriptor getTargetByCRC(int crc)
Returns the TargetDescriptor that matches the specified CRC-32 checksum.

Parameters:
crc - the CRC-32 checksum.
Returns:
the TargetDescriptor that matches the specified checksum, or null, if none could be found in this descriptor.


See http://www.xins.org/.