org.planx.io
Class Locator

java.lang.Object
  extended by org.planx.io.Locator
All Implemented Interfaces:
Comparable<Locator>, Locatable
Direct Known Subclasses:
Bound

public class Locator
extends Object
implements Comparable<Locator>, Locatable

A Locator consists of a position and a SourceId.

Author:
Thomas Ambus

Nested Class Summary
static class Locator.CompactStreamer
          A Streamer capable of converting a Locator to and from byte representation.
 
Constructor Summary
Locator(long pos, SourceId fsi)
           
 
Method Summary
 int compareTo(Locator l)
          Returns a negative integer if this Locator has a position less than the argument Locator, zero if they have the same position and a positive integer if this Locator has a position greater than the argument Locator.
 boolean equals(Object o)
           
static org.planx.msd.Discriminator<Locator> getDiscriminator(org.planx.msd.Memory memory)
          Returns a Discriminator capable of multiset discrimination of Locators.
static SizeStreamer<Locator> getStreamer()
          Returns a Streamer capable of converting a Locator to and from byte representation.
 int hashCode()
           
 SourceId id()
          Returns the SourceId associated with this Locator or null if none is associated.
 Locator location()
          Returns this Locator.
 long position()
          Returns the position of this locator.
 void setId(SourceId fsi)
          Sets the SourceId of this locator.
 void setPosition(long pos)
          Sets the position of this locator.
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Locator

public Locator(long pos,
               SourceId fsi)
Method Detail

location

public Locator location()
Returns this Locator.

Specified by:
location in interface Locatable

position

public long position()
Returns the position of this locator.


setPosition

public void setPosition(long pos)
Sets the position of this locator.


id

public SourceId id()
Returns the SourceId associated with this Locator or null if none is associated.


setId

public void setId(SourceId fsi)
Sets the SourceId of this locator.


equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(Locator l)
Returns a negative integer if this Locator has a position less than the argument Locator, zero if they have the same position and a positive integer if this Locator has a position greater than the argument Locator.

Specified by:
compareTo in interface Comparable<Locator>

toString

public String toString()
Overrides:
toString in class Object

getStreamer

public static SizeStreamer<Locator> getStreamer()
Returns a Streamer capable of converting a Locator to and from byte representation. The streamer is not compatible with data written by Locator.CompactStreamer.


getDiscriminator

public static org.planx.msd.Discriminator<Locator> getDiscriminator(org.planx.msd.Memory memory)
Returns a Discriminator capable of multiset discrimination of Locators.



Copyright © 2004-2005 Plan-X. All Rights Reserved.