PTP
Release 5.0

org.eclipse.ptp.ui.model
Class ElementSet

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.ptp.ui.model.Element
          extended by org.eclipse.ptp.ui.model.ElementSet
All Implemented Interfaces:
Cloneable, Comparable<IElement>, org.eclipse.core.runtime.IAdaptable, IElement, IElementSet
Direct Known Subclasses:
ElementHandler

public class ElementSet
extends Element
implements IElementSet


Field Summary
 
Fields inherited from class org.eclipse.ptp.ui.model.Element
id, name, parent, pElement, registered, selected
 
Constructor Summary
ElementSet(IElement parent, String id, String name)
           
 
Method Summary
 void addElements(IElement[] elements)
          Adds given elements to this set
 void addMatchSet(String setID)
          Store a list which set also contains the same element Adds to match set of given set id
 void clean()
          Remove all the elements in this set
 int compareTo(String s1, String s2)
           
 boolean contains(IElement element)
          Returns whether this set contains given element
 boolean contains(String id)
          Returns whether this set contains given element id
 boolean containsMatchSet(String setID)
          Returns whether given set id contains in match list
 int findIndexByID(String id)
          Returns position of given element id
 int findIndexByName(String name)
          Returns position of given element name
 IElement getElement(int index)
          Returns element by given index
 IElement getElementByID(String id)
          Returns element by given element id
 IElement getElementByName(String name)
          Returns element by given element name
 IElement[] getElements()
          Returns an array of elements of this set
 String[] getMatchSetIDs()
          Returns an array of match set id
 boolean isRootSet()
          Returns whether this set is root or not
 void removeElement(String id)
          Removes Element from this set
 void removeElements(IElement[] elements)
          Removes given elements from this set
 void removeMatchSet(String setID)
          Removes match sets of given set id
 int size()
          Returns total elements of this set
 
Methods inherited from class org.eclipse.ptp.ui.model.Element
cloneElement, compareTo, getID, getName, getParent, getPElement, isRegistered, isSelected, setRegistered, setSelected
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ptp.ui.model.IElement
cloneElement, getID, getName, getParent, getPElement, isRegistered, isSelected, setRegistered, setSelected
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

ElementSet

public ElementSet(IElement parent,
                  String id,
                  String name)
Method Detail

isRootSet

public boolean isRootSet()
Description copied from interface: IElementSet
Returns whether this set is root or not

Specified by:
isRootSet in interface IElementSet
Returns:
true if this set is root

addElements

public void addElements(IElement[] elements)
Description copied from interface: IElementSet
Adds given elements to this set

Specified by:
addElements in interface IElementSet

getElement

public IElement getElement(int index)
Description copied from interface: IElementSet
Returns element by given index

Specified by:
getElement in interface IElementSet
Returns:
element

getElementByID

public IElement getElementByID(String id)
Description copied from interface: IElementSet
Returns element by given element id

Specified by:
getElementByID in interface IElementSet
Parameters:
id - element id
Returns:
element

getElementByName

public IElement getElementByName(String name)
Description copied from interface: IElementSet
Returns element by given element name

Specified by:
getElementByName in interface IElementSet
Parameters:
name - element name
Returns:
element

findIndexByID

public int findIndexByID(String id)
Description copied from interface: IElementSet
Returns position of given element id

Specified by:
findIndexByID in interface IElementSet
Parameters:
id - element id
Returns:
position of given element id

findIndexByName

public int findIndexByName(String name)
Description copied from interface: IElementSet
Returns position of given element name

Specified by:
findIndexByName in interface IElementSet
Parameters:
name - element name
Returns:
position of given element name

getElements

public IElement[] getElements()
Description copied from interface: IElementSet
Returns an array of elements of this set

Specified by:
getElements in interface IElementSet
Returns:
an array of elements

removeElements

public void removeElements(IElement[] elements)
Description copied from interface: IElementSet
Removes given elements from this set

Specified by:
removeElements in interface IElementSet

removeElement

public void removeElement(String id)
Description copied from interface: IElementSet
Removes Element from this set

Specified by:
removeElement in interface IElementSet

compareTo

public int compareTo(String s1,
                     String s2)

size

public int size()
Description copied from interface: IElementSet
Returns total elements of this set

Specified by:
size in interface IElementSet
Returns:
total elements of this set

clean

public void clean()
Description copied from interface: IElementSet
Remove all the elements in this set

Specified by:
clean in interface IElementSet

contains

public boolean contains(IElement element)
Description copied from interface: IElementSet
Returns whether this set contains given element

Specified by:
contains in interface IElementSet
Returns:
whether this set contains given element

contains

public boolean contains(String id)
Description copied from interface: IElementSet
Returns whether this set contains given element id

Specified by:
contains in interface IElementSet
Returns:
whether this set contains given element id

addMatchSet

public void addMatchSet(String setID)
Description copied from interface: IElementSet
Store a list which set also contains the same element Adds to match set of given set id

Specified by:
addMatchSet in interface IElementSet
Parameters:
setID - set id

removeMatchSet

public void removeMatchSet(String setID)
Description copied from interface: IElementSet
Removes match sets of given set id

Specified by:
removeMatchSet in interface IElementSet
Parameters:
setID - set id

containsMatchSet

public boolean containsMatchSet(String setID)
Description copied from interface: IElementSet
Returns whether given set id contains in match list

Specified by:
containsMatchSet in interface IElementSet
Returns:
true if given set id contains in match list

getMatchSetIDs

public String[] getMatchSetIDs()
Description copied from interface: IElementSet
Returns an array of match set id

Specified by:
getMatchSetIDs in interface IElementSet
Returns:
an array of match set id

PTP
Release 5.0

Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.