net.jolsrv2.repository.neighbourhood
Class MprSelectorSet

java.lang.Object
  extended by net.jolsrv2.repository.neighbourhood.MprSelectorSet

public final class MprSelectorSet
extends java.lang.Object

The class implements the MPR selector set, as specified in OLSRv2.

Author:
Andreas Schjønhaug

Method Summary
 java.lang.Object clone()
          Implementation of the singleton design pattern.
 boolean contains(CidrAddress cidrAddress)
          Checks to see if a CIDR addresses is present in the MPR selector set
 java.util.ArrayList<CidrAddress> getCAddresses()
          Returns the CIDR addresses found in the MPR selector tuples.
static MprSelectorSet getMprSelectorSet()
          Implementation of the singleton design pattern
 boolean populate(CidrAddress localCAddresses, java.util.ArrayList<CidrAddress> libCAddresses, java.util.ArrayList<CidrAddress> cidrAddresses, java.util.ArrayList<Tlv> tlvs, long validityTime)
          Populates the MPR selector set.
 boolean purge()
          The method purges the MPR selector set for expired entries
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMprSelectorSet

public static MprSelectorSet getMprSelectorSet()
Implementation of the singleton design pattern

Returns:
the MPR selector set

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Implementation of the singleton design pattern. This method is used to ensure that the class can not be cloned.

Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

populate

public boolean populate(CidrAddress localCAddresses,
                        java.util.ArrayList<CidrAddress> libCAddresses,
                        java.util.ArrayList<CidrAddress> cidrAddresses,
                        java.util.ArrayList<Tlv> tlvs,
                        long validityTime)
Populates the MPR selector set.

Parameters:
localCAddresses - the local CIDR address
libCAddresses - the LIB CIDR addresses
cidrAddresses - the CIDR addresses
tlvs - the TLVs
validityTime - the validity time
Returns:
true if a change in the MPR selector set is detected

getCAddresses

public java.util.ArrayList<CidrAddress> getCAddresses()
Returns the CIDR addresses found in the MPR selector tuples.

Returns:
an ArrayList of the CIDR addresses

contains

public boolean contains(CidrAddress cidrAddress)
Checks to see if a CIDR addresses is present in the MPR selector set

Parameters:
cidrAddress - the CIDR address
Returns:
true if found

purge

public boolean purge()
The method purges the MPR selector set for expired entries

Returns:
true if a change is found