org.ccnx.ccn.profiles.versioning.InterestData Class Reference

Stores state about a specific Interest on the wire. More...

List of all members.

Classes

class  StartTimeComparator

Public Member Functions

 InterestData (ContentName basename)
 An Interest with unbounded timespan.
 InterestData (ContentName basename, VersionNumber startTime)
 An Interest with only a lower bound.
 InterestData (ContentName basename, VersionNumber startTime, VersionNumber stopTime)
synchronized int size ()
synchronized boolean equals (Object obj) throws ClassCastException
 Implement equals based on name, startTime, stopTime, and the excluded version numbers.
synchronized int hashCode ()
 Implement hashCode() so we can ensure consistency with equals.
synchronized void setStartTime (VersionNumber startTime)
 Dont do this while in a sorted set, as the sort order will break.
synchronized void setStopTime (VersionNumber stopTime)
 stopTime is the maximum version to include.
synchronized boolean addExclude (VersionNumber version)
 Returns false if too many excludes in this Interest.
synchronized Interest buildInterest ()
Interest getLastInterest ()
 return the last interest built.
synchronized boolean contains (VersionNumber version)
 Is version contained in [startTime, stopTime]? Uses UNSIGNED COMPARISON.
String toString ()
String dumpContents ()
synchronized InterestData splitLeft (int count)
 Split this object to the left, transfering count elements.
synchronized InterestData splitRight (int count)
 Split this object to the right, transfering count elements.
void transferLeft (InterestData left, int count)
 transfer count items from head of exclusion list to left.
void transferRight (InterestData right, int count)
 transfer count items from tail of exclusion list to right.
synchronized VersionNumber getStartVersion ()
synchronized VersionNumber getStopVersion ()
synchronized long getWidth ()
synchronized double getDensity ()
synchronized boolean validate ()
 Sanity check that all the excluded versions fall between [start, stop] inclusive, using unsigned comparison.

Protected Member Functions

synchronized void addExcludeUnbounded (VersionNumber version)
 Used internally.

Detailed Description

Stores state about a specific Interest on the wire.

This class does not do any network transactions, it only stores state about a specific interest and will generate a new Interest message based on its current start, stop, and exclusion list.


Constructor & Destructor Documentation

org.ccnx.ccn.profiles.versioning.InterestData.InterestData ( ContentName  basename  ) 

An Interest with unbounded timespan.

Parameters:
basename 
org.ccnx.ccn.profiles.versioning.InterestData.InterestData ( ContentName  basename,
VersionNumber  startTime 
)

An Interest with only a lower bound.

Parameters:
basename 
startTime 
org.ccnx.ccn.profiles.versioning.InterestData.InterestData ( ContentName  basename,
VersionNumber  startTime,
VersionNumber  stopTime 
)
Parameters:
startTime minimum version to include.
stopTime maximum version to include.

Member Function Documentation

synchronized boolean org.ccnx.ccn.profiles.versioning.InterestData.addExclude ( VersionNumber  version  ) 

Returns false if too many excludes in this Interest.

Parameters:
version 
Returns:
synchronized void org.ccnx.ccn.profiles.versioning.InterestData.addExcludeUnbounded ( VersionNumber  version  )  [protected]

Used internally.

Sometimes we want to intentionally overflow

Parameters:
version 
synchronized boolean org.ccnx.ccn.profiles.versioning.InterestData.contains ( VersionNumber  version  ) 

Is version contained in [startTime, stopTime]? Uses UNSIGNED COMPARISON.

Parameters:
version 
Returns:
synchronized long org.ccnx.ccn.profiles.versioning.InterestData.getWidth (  ) 
Returns:
stopTime - startTime + 1
synchronized void org.ccnx.ccn.profiles.versioning.InterestData.setStartTime ( VersionNumber  startTime  ) 

Dont do this while in a sorted set, as the sort order will break.

Start time is the minimum version to include. in milliseconds (not binarytime)

Parameters:
startTime minimum version to include (milliseconds). The earliest time is NO_START_TIME. if a startTime < NO_START_TIME is given (e.g. 0), NO_START_TIME is used.
synchronized void org.ccnx.ccn.profiles.versioning.InterestData.setStopTime ( VersionNumber  stopTime  ) 

stopTime is the maximum version to include.

use NO_STOP_TIME for infinity. If a greater value (unsigned comparison) is given, NO_STOP_TIME is used. in milliseconds (not binarytime)

void org.ccnx.ccn.profiles.versioning.InterestData.transferLeft ( InterestData  left,
int  count 
)

transfer count items from head of exclusion list to left.

Caller has verified that count items will fit in left.

Parameters:
left 
count 
void org.ccnx.ccn.profiles.versioning.InterestData.transferRight ( InterestData  right,
int  count 
)

transfer count items from tail of exclusion list to right.

Caller has verified that count items will fit in right.

Parameters:
right 
count 
synchronized boolean org.ccnx.ccn.profiles.versioning.InterestData.validate (  ) 

Sanity check that all the excluded versions fall between [start, stop] inclusive, using unsigned comparison.

Returns:

The documentation for this class was generated from the following file:
Generated on Fri May 13 16:27:49 2011 for Content-Centric Networking in Java by  doxygen 1.6.3