Package org.jcsp.net
Class Profile
- java.lang.Object
-
- org.jcsp.net.Profile
-
public class Profile extends java.lang.ObjectThis class is used to hold profiles of Nodes and Links.
Node profiles are not currently used.
Profile functionality is still being implemented.
-
-
Field Summary
Fields Modifier and Type Field Description private static ProfilealwaysMatchProfileprivate booleanexactprivate static java.util.HashtablelinkProfilesprivate java.lang.Stringnameprivate static java.util.HashtablenodeProfilesprivate Requirement[]requirementsprivate booleansystem
-
Constructor Summary
Constructors Modifier Constructor Description privateProfile(java.lang.String name, Requirement[] requirements, boolean exact, boolean system)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static voidcreateNewLinkProfile(java.lang.String name, Requirement[] requirements, boolean exact)(package private) static voidcreateNewNodeProfile(java.lang.String name, Requirement[] requirements, boolean exact)booleanequals(java.lang.Object o)Compares this Profile with another object.(package private) static ProfilegetAlwaysMatchProfile()static ProfilegetLinkProfile(java.lang.String name)Returns a link profile of a certain name from a static collection of link profiles.static ProfilegetNodeProfile(java.lang.String name)Returns a Node profile of a certain name from a static collection of Node profiles.(package private) static ProfilegetProtocolProfile(ProtocolID protocolID)inthashCode()Returns a hash code for this object that follows the standard rule for hash codes stated in theObjectclass.(package private) intmatches(Specification[] specs)This tests whether a an array of Specification objects meet the requirements of this profile.(package private) booleanrequiresExactMatch()
-
-
-
Field Detail
-
alwaysMatchProfile
private static Profile alwaysMatchProfile
-
linkProfiles
private static java.util.Hashtable linkProfiles
-
nodeProfiles
private static java.util.Hashtable nodeProfiles
-
name
private java.lang.String name
-
exact
private boolean exact
-
system
private boolean system
-
requirements
private Requirement[] requirements
-
-
Constructor Detail
-
Profile
private Profile(java.lang.String name, Requirement[] requirements, boolean exact, boolean system)
-
-
Method Detail
-
createNewLinkProfile
static void createNewLinkProfile(java.lang.String name, Requirement[] requirements, boolean exact)
-
createNewNodeProfile
static void createNewNodeProfile(java.lang.String name, Requirement[] requirements, boolean exact)
-
getLinkProfile
public static Profile getLinkProfile(java.lang.String name)
Returns a link profile of a certain name from a static collection of link profiles.- Parameters:
name- the name of theProfileto obtain.- Returns:
- a matching link profile or null if no match is found.
-
getNodeProfile
public static Profile getNodeProfile(java.lang.String name)
Returns a Node profile of a certain name from a static collection of Node profiles.- Parameters:
name- the name of theProfileto obtain.- Returns:
- a matching Node profile or null if no match is found.
-
getAlwaysMatchProfile
static Profile getAlwaysMatchProfile()
-
getProtocolProfile
static Profile getProtocolProfile(ProtocolID protocolID)
-
matches
int matches(Specification[] specs)
This tests whether a an array of Specification objects meet the requirements of this profile. This method will sort the array of specs in order of name. This sort will change the original array.
-
requiresExactMatch
boolean requiresExactMatch()
-
equals
public boolean equals(java.lang.Object o)
Compares this Profile with another object.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- another object to compare with this object.- Returns:
trueiff the supplied object is aProfileobject that is exactly equal.
-
hashCode
public int hashCode()
Returns a hash code for this object that follows the standard rule for hash codes stated in theObjectclass.- Overrides:
hashCodein classjava.lang.Object- Returns:
- an
inthash code for this object.
-
-