org.planx.xmlstore.io
Class LocalLocator
java.lang.Object
org.planx.xmlstore.io.LocalLocator
- All Implemented Interfaces:
- Comparable<LocalLocator>, Reference, Locator
public class LocalLocator
- extends Object
- implements Locator, Comparable<LocalLocator>
A LocalLocator consists of a file offset, a length, and a
FileSystemIdentifier. The file offset and the
FileSystemIdentifier uniquely identifies a
LocalLocator. The length is merely used for
efficient de-allocation of the space occupied in the FileSystem.
TODO: Only path compression is currently performed. Add union-by-rank.
- Author:
- Thomas Ambus
CLASS_ID
public static final byte CLASS_ID
- See Also:
- Constant Field Values
off
protected int off
len
protected int len
fsi
protected FileSystemIdentifier fsi
eqref
protected LocalLocator eqref
LocalLocator
public LocalLocator(int off,
int len,
FileSystemIdentifier fsi)
clone
public LocalLocator clone()
- Careful with this! It breaks union-find for in-memory locators.
- Overrides:
clone in class Object
find
protected LocalLocator find()
getFileSystemId
public FileSystemIdentifier getFileSystemId()
setFileSystemId
public void setFileSystemId(FileSystemIdentifier fsi)
locatorMoved
public void locatorMoved(LocalLocator loc)
getOff
public int getOff()
getLen
public int getLen()
isContained
public boolean isContained(LocalLocator l)
equals
public boolean equals(Object o)
- Overrides:
equals in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
compareTo
public int compareTo(LocalLocator loc)
- Specified by:
compareTo in interface Comparable<LocalLocator>
toString
public String toString()
- Overrides:
toString in class Object
getStreamer
public static Streamer<LocalLocator> getStreamer(boolean isCompact)
getDiscriminator
public static Discriminator<LocalLocator> getDiscriminator(Memory memory)
Copyright © 2010. All Rights Reserved.