|
Ila | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.topoweb.ila.State
The respresentation of the state of a node in an Ila
system. Instances are immutable. This class may be subclassed, but
the accessor methods defined here are final. This immutability allows
us to enforce some minimum criteria for State
instances.
See the constructor for details.
StateBuffer
,
Node.getState()
Field Summary |
Fields inherited from interface org.topoweb.ila.StateConstants |
NF, NK, NV, OK |
Fields inherited from interface org.topoweb.ila.NodeConstants |
BACK, FIRST_PAGE, FORE, LAST_PAGE, LINK_MASK, PAGE_MASK |
Constructor Summary | |
State(int status,
int versionId,
long versionTimestamp,
int syncVersionId,
long syncVersionTimestamp,
int forelinkCount,
int coForelinkCount,
long backlinkCount,
long coBacklinkCount)
Creates a new instance. |
Method Summary | |
long |
getCoLinkCount(int type)
Returns the co-link count for the specified link type . |
long |
getLinkCount(int type)
Returns the link count for the specified link type . |
int |
getStatus()
Returns the status code for the instance. |
int |
getSyncVersionId()
Returns the sync version ID for this instance. |
long |
getSyncVersionTimestamp()
Returns the version timestamp for this instance. |
int |
getVersionId()
Returns the version ID for this instance. |
long |
getVersionTimestamp()
Returns the version timestamp for this instance. |
static java.lang.String |
statusToString(int status)
Returns a string representation of an integral status code as defined by StateConstants . |
boolean |
supercedes(State other)
Does this instance supercede the other ? Uses the version
ID to determine which instance is more recent. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public State(int status, int versionId, long versionTimestamp, int syncVersionId, long syncVersionTimestamp, int forelinkCount, int coForelinkCount, long backlinkCount, long coBacklinkCount) throws java.lang.IllegalArgumentException
status
- the status, as defined by StateConstants
versionId
- the version IDversionTimestamp
- the version timestampsyncVersionId
- the sync version IDsyncVersionTimestamp
- the sync version timestampforelinkCount
- the total number of forelinkscoForelinkCount
- the total number of co--forelinksbacklinkCount
- the total number of backlinkscoBacklinkCount
- the total number of co-backlinks
java.lang.IllegalArgumentException
- status
is neither of
OK
, or
NF
, or
NV
, or
NK
;backlinkCount
, or
coBacklinkCount
, or
forelinkCount
, or
coForelinkCount
is < 0;status
is not
OK
and either of
forelinkCount
, or
coForelinkCount
is > 0;status
is NK
and either of backlinkCount
, or
coBacklinkCount
!= 0;syncVersionId
supercedes the
versionId
(syncVersionId
- versionId
> 0);syncVersionTimestamp
< 0;syncVersionTimestamp
>
versionTimestamp
;coForelinkCount
>
forelinkCount
;coBacklinkCount
>
backlinkCount
Method Detail |
public final int getStatus()
OK
, or NF
, or NV
, or NK
.
StateConstants
public static java.lang.String statusToString(int status) throws java.lang.IllegalArgumentException
StateConstants
. The string representations are
just the constant names "OK
",
"NF
", "NV
", and
"NK
".
status
- the status code
status
code
java.lang.IllegalArgumentException
- if the value of status
is not defined
by StateConstants
StateConstants
public final int getVersionId()
node
is updated in Ila, the version ID is bumped up by
one. This version ID scheme allows us to determine which version
of a node
is more recent than another.
public final long getVersionTimestamp()
public final int getSyncVersionId()
node
when its information was last
synchronized with the node
s it is linked to.
public final long getSyncVersionTimestamp()
public final boolean supercedes(State other)
other
? Uses the version
ID to determine which instance is more recent. The exact condition for
supercession is
other
- the other instance tested against
true
, if this instance supercedes
the other
; false
, o.w.public final long getLinkCount(int type)
type
. The
returned value is the total number of links for the specified type.
From this method's perspective, the value of type
is
always well defined, as only its first bit is examined.
type
- the link type
(type & LINK_MASK)
== FORE
; the backlink count, o.w.public final long getCoLinkCount(int type)
type
. For
any given link type, its co-links are a subset of the links for that
type. We are not hammering down its exact meaning; it's supposed to
indicate the number of links from node
s that are
more-or-less administered by the same owner -- i.e., nodes that are
probably cohorts of a given node. For a node representing an
HTTP document, then, a co-link might be defined as a link to or from
another document on the same server.
From this method's perspective, the value of type
is
always well defined, as only its first bit is examined.
type
- the link type
(type &
LINK_MASK) == FORE
; the co-backlink count,
o.w.
|
Ila | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |