public class Relation
extends java.lang.Object
implements java.lang.Cloneable
Library simAuxLibrary, Class Relation
Copyright by Klaus Hufschlag 2004,2005,2006
This file is part of the Generic Classifier Library. The Generic Classifier Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The Generic Classifier Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the Generic Classifier Library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Constructor and Description |
---|
Relation()
Standardconstructor, creates an empty instance.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Relation r)
add adds the entire oder of another relation to the Instance.
|
void |
addRel(java.lang.Object parent,
java.lang.Object child)
addRel method for adding a new parent-child relation.
|
boolean |
checkRel(java.lang.Object parent,
java.lang.Object child)
checkRel checks whether there is a (direct or indirect) relation between the objects
|
java.lang.Object |
clone() |
void |
delRel(java.lang.Object parent,
java.lang.Object child)
delRel, method to remove a given relation, specified by parent and child
|
java.util.ArrayList |
getChildren(java.lang.Object parent)
getChildren method return all direct child Objects.
|
java.util.ArrayList |
getParents(java.lang.Object child)
getParents method returns all direct parent Objects.
|
void |
remove()
remove method to remove all relations.
|
void |
remove(java.lang.Object o)
remove method to remove an Object of all relations.
|
public void addRel(java.lang.Object parent, java.lang.Object child)
parent
- parent to setchild
- child to setpublic void delRel(java.lang.Object parent, java.lang.Object child)
parent
- parent to specify relationchild
- child to specifiy relationpublic void remove(java.lang.Object o)
o
- Object to removepublic void remove()
public java.util.ArrayList getParents(java.lang.Object child)
child
- child to find parentspublic java.util.ArrayList getChildren(java.lang.Object parent)
parent
- to find childrenpublic boolean checkRel(java.lang.Object parent, java.lang.Object child)
parent
- Object to be checked for being superordinatechild
- Object to be checked for being subordinatepublic void add(Relation r)
r
- Relation to integratepublic java.lang.Object clone()
clone
in class java.lang.Object