Class Profiles
- java.lang.Object
-
- edu.isi.pegasus.planner.catalog.classes.Profiles
-
public class Profiles extends java.lang.ObjectMaintains profiles for different namespaces.- Version:
- $Revision$
- Author:
- Karan Vahi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProfiles.NAMESPACESThe enumeration of valid namespaces.
-
Field Summary
Fields Modifier and Type Field Description private java.util.EnumMap<Profiles.NAMESPACES,Namespace>mProfileMapAn enum map that associates the enum keys with the corresponding namespace objects.
-
Constructor Summary
Constructors Constructor Description Profiles()The default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProfile(Profiles.NAMESPACES namespace, java.lang.String key, java.lang.String value)Add a profile.voidaddProfile(Profile p)Adds a profile.voidaddProfile(java.lang.String namespace, java.lang.String key, java.lang.String value)Add a profile.voidaddProfileDirectly(Profiles.NAMESPACES namespace, java.lang.String key, java.lang.String value)Add a profile.voidaddProfileDirectly(Profile p)Adds a profile directly to namespace bypassing any underlying namespace specific checks.voidaddProfileDirectly(java.lang.String namespace, java.lang.String key, java.lang.String value)Add a profile.voidaddProfiles(Profiles profiles)Adds multiple profiles.voidaddProfiles(java.util.List<Profile> profiles)Adds multiple profiles.voidaddProfilesDirectly(Profiles profiles)Adds multiple profiles .voidaddProfilesDirectly(java.util.List<Profile> profiles)Adds multiple profiles to namespace bypassing any underlying namespace specific checks.java.lang.Objectclone()Returns the clone of the object.Namespaceget(Profiles.NAMESPACES n)Returns the namespace object corresponding to a namespaceprivate intgetIndex(Profiles.NAMESPACES u)Returns the index for the namespace.java.util.IteratorgetProfileKeyIterator(Profiles.NAMESPACES n)Returns a iterator over the profile keys corresponding to a particular namespace.java.util.List<Profile>getProfiles()Returns the list of profiles for all namespaces.java.util.List<Profile>getProfiles(Profiles.NAMESPACES namespace)Returns the list of profiles corresponding to a single namespacejava.util.List<Profile>getProfiles(Namespace namespace)Returns the list of profiles corresponding to a single namespacejava.util.List<Profile>getProfiles(java.lang.String namespace)Returns the list of profiles corresponding to a single namespacebooleanisEmpty()Returns a boolean indicating if the object is empty.static voidmain(java.lang.String[] args)java.lang.StringtoString()Returns the string description of the object.voidtoString(java.io.Writer writer, java.lang.String indent)Writes out the contents of the object as a Stringjava.lang.StringtoXML()Returns the xml description of the object.voidtoXML(java.io.Writer writer, java.lang.String indent)Writes out the xml description of the object.voidwriteAttribute(java.io.Writer writer, java.lang.String key, java.lang.String value)Writes an attribute to the stream.
-
-
-
Field Detail
-
mProfileMap
private java.util.EnumMap<Profiles.NAMESPACES,Namespace> mProfileMap
An enum map that associates the enum keys with the corresponding namespace objects.
-
-
Method Detail
-
addProfiles
public void addProfiles(Profiles profiles)
Adds multiple profiles.- Parameters:
profiles- the profiles object
-
addProfiles
public void addProfiles(java.util.List<Profile> profiles)
Adds multiple profiles.- Parameters:
profiles- List ofProfileobjects.
-
addProfilesDirectly
public void addProfilesDirectly(Profiles profiles)
Adds multiple profiles . to namespace bypassing any underlying namespace specific checks. The catalog parsers should use this function- Parameters:
profiles- the profiles object
-
addProfilesDirectly
public void addProfilesDirectly(java.util.List<Profile> profiles)
Adds multiple profiles to namespace bypassing any underlying namespace specific checks. The catalog parsers should use this function.- Parameters:
profiles- List ofProfileobjects.
-
addProfileDirectly
public void addProfileDirectly(Profile p)
Adds a profile directly to namespace bypassing any underlying namespace specific checks. The catalog parsers should use this function.- Parameters:
p- the profile to be added
-
addProfile
public void addProfile(Profile p)
Adds a profile.- Parameters:
p- the profile to be added
-
addProfileDirectly
public void addProfileDirectly(Profiles.NAMESPACES namespace, java.lang.String key, java.lang.String value)
Add a profile. Convenience method- Parameters:
namespace-key-value-
-
addProfileDirectly
public void addProfileDirectly(java.lang.String namespace, java.lang.String key, java.lang.String value)Add a profile. Convenience method- Parameters:
namespace-key-value-
-
addProfile
public void addProfile(Profiles.NAMESPACES namespace, java.lang.String key, java.lang.String value)
Add a profile. Convenience method- Parameters:
namespace-key-value-
-
addProfile
public void addProfile(java.lang.String namespace, java.lang.String key, java.lang.String value)Add a profile. Convenience method- Parameters:
namespace-key-value-
-
getProfiles
public java.util.List<Profile> getProfiles()
Returns the list of profiles for all namespaces.- Returns:
- List of
Profiles
-
getProfiles
public java.util.List<Profile> getProfiles(java.lang.String namespace)
Returns the list of profiles corresponding to a single namespace- Parameters:
namespace- the namespace- Returns:
- List of
Profiles
-
getProfiles
public java.util.List<Profile> getProfiles(Profiles.NAMESPACES namespace)
Returns the list of profiles corresponding to a single namespace- Parameters:
namespace- the namespace- Returns:
- List of
Profiles
-
getProfiles
public java.util.List<Profile> getProfiles(Namespace namespace)
Returns the list of profiles corresponding to a single namespace- Parameters:
namespace- the namespace- Returns:
- List of
Profiles
-
getProfileKeyIterator
public java.util.Iterator getProfileKeyIterator(Profiles.NAMESPACES n)
Returns a iterator over the profile keys corresponding to a particular namespace.- Parameters:
n- the namespace- Returns:
- iterator
-
get
public Namespace get(Profiles.NAMESPACES n)
Returns the namespace object corresponding to a namespace- Parameters:
n- the namespace- Returns:
- Namespace
-
isEmpty
public boolean isEmpty()
Returns a boolean indicating if the object is empty. The object is empty if all the underlying profile maps are empty.- Returns:
-
toXML
public void toXML(java.io.Writer writer, java.lang.String indent) throws java.io.IOExceptionWrites out the xml description of the object.- Parameters:
writer- is a Writer opened and ready for writing. This can also be a StringWriter for efficient output.indent- the indent to be used.- Throws:
java.io.IOException- if something fishy happens to the stream.
-
toString
public java.lang.String toString()
Returns the string description of the object.- Overrides:
toStringin classjava.lang.Object- Returns:
- String containing the object in XML.
- Throws:
java.lang.RuntimeException- if something fishy happens to the stream.
-
toString
public void toString(java.io.Writer writer, java.lang.String indent) throws java.io.IOExceptionWrites out the contents of the object as a String- Parameters:
writer- is a Writer opened and ready for writing. This can also be a StringWriter for efficient output.indent- the indent to be used.- Throws:
java.io.IOException- if something fishy happens to the stream.
-
clone
public java.lang.Object clone()
Returns the clone of the object.- Overrides:
clonein classjava.lang.Object- Returns:
- the clone
-
toXML
public java.lang.String toXML() throws java.io.IOExceptionReturns the xml description of the object. This is used for generating the partition graph. That is no longer done.- Returns:
- String containing the object in XML.
- Throws:
java.io.IOException- if something fishy happens to the stream.
-
writeAttribute
public void writeAttribute(java.io.Writer writer, java.lang.String key, java.lang.String value) throws java.io.IOExceptionWrites an attribute to the stream. Wraps the value in quotes as required by XML.- Parameters:
writer-key-value-- Throws:
java.io.IOException- if something fishy happens to the stream.
-
getIndex
private int getIndex(Profiles.NAMESPACES u)
Returns the index for the namespace.- Parameters:
u- the unit- Returns:
- the index.
-
main
public static void main(java.lang.String[] args)
- Parameters:
args-
-
-