edu.utdallas.paged.mem.algorithm
Class CacheAlgorithmBase

java.lang.Object
  extended by edu.utdallas.paged.mem.algorithm.CacheAlgorithmBase
All Implemented Interfaces:
java.lang.Comparable<java.lang.Object>
Direct Known Subclasses:
NodeStampDegreeCentrality, NodeStampFIFO, NodeStampIndividualCC, NodeStampLIFO, NodeStampLRU, NodeStampMRU, NodeStampTransitiveCC

public abstract class CacheAlgorithmBase
extends java.lang.Object
implements java.lang.Comparable<java.lang.Object>

An abstract class for the cache algorithms. This class only has one abstract method, compareTo(Object o1), since this method decides the way the algorithm is implemented

Author:
vaibhav

Field Summary
 int connections
          The number of connections for this node
 java.util.Calendar currTime
          The last time this node was accessed
 double individualCC
          The individual clustering coefficient for this node
 double transitiveCC
          The transitive clustering coefficient for this node
 
Constructor Summary
CacheAlgorithmBase()
           
 
Method Summary
abstract  int compareTo(java.lang.Object o1)
          Method that implements the comparable interface
 int getConnections()
          Method to get the number of current connections for this node
 java.util.Calendar getCurrentTime()
          Method to get the last time this node was accessed
 double getIndividualCC()
          Method to get the individual clustering coefficient for this node
 double getTransitiveCC()
          Method to get the transitive clustering coefficient for this node
 void setConnections()
          Method to increment the number of connections of this node
 void setCurrentTime(java.util.Calendar currentTime)
          Method that sets the access time of this node to the current time
 void setIndividualCC(double newCoefficient)
          Method to set the individual clustering coefficient for this node
 void setTransitiveCC(double newCoefficient)
          Method to set the individual clustering coefficient for this node
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currTime

public java.util.Calendar currTime
The last time this node was accessed


connections

public int connections
The number of connections for this node


individualCC

public double individualCC
The individual clustering coefficient for this node


transitiveCC

public double transitiveCC
The transitive clustering coefficient for this node

Constructor Detail

CacheAlgorithmBase

public CacheAlgorithmBase()
Method Detail

compareTo

public abstract int compareTo(java.lang.Object o1)
Method that implements the comparable interface

Specified by:
compareTo in interface java.lang.Comparable<java.lang.Object>
Parameters:
o1 - - object against which the current object is compared
Returns:
an integer based on the algorithm implemented, e.g., for LRU it returns an integer based on whether the current node comes before the parameter node

getConnections

public int getConnections()
Method to get the number of current connections for this node

Returns:
the number of connections

setConnections

public void setConnections()
Method to increment the number of connections of this node


getCurrentTime

public java.util.Calendar getCurrentTime()
Method to get the last time this node was accessed

Returns:
the last time this node was accessed

setCurrentTime

public void setCurrentTime(java.util.Calendar currentTime)
Method that sets the access time of this node to the current time

Parameters:
currentTime - - the current time when this node is accessed

getIndividualCC

public double getIndividualCC()
Method to get the individual clustering coefficient for this node


setIndividualCC

public void setIndividualCC(double newCoefficient)
Method to set the individual clustering coefficient for this node


getTransitiveCC

public double getTransitiveCC()
Method to get the transitive clustering coefficient for this node


setTransitiveCC

public void setTransitiveCC(double newCoefficient)
Method to set the individual clustering coefficient for this node