public class ConcRel
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private java.util.Set<ConcRel> |
children
children of this concept
|
private int[] |
childrenArray |
private short |
depth |
private double |
intrinsicInfoContent |
private static java.util.logging.Logger |
log |
private java.lang.String |
nodeCUI
id of this concept
|
private int |
nodeIndex |
private java.util.Set<ConcRel> |
parents
parents of this concept
|
private int[] |
parentsArray
for java object serialization, need to avoid default serializer behavior
of writing out entire object graph.
|
private static long |
serialVersionUID |
Constructor and Description |
---|
ConcRel(java.lang.String cui,
int nodeIndex) |
Modifier and Type | Method and Description |
---|---|
void |
constructRel(java.util.List<ConcRel> db)
reconstruct the relationships to other ConcRel objects
|
static java.util.List<java.lang.String> |
crListToString(java.util.List<ConcRel> crList) |
int |
depthMax() |
boolean |
equals(java.lang.Object obj) |
java.util.Set<ConcRel> |
getChildren() |
int[] |
getChildrenArray() |
java.lang.String |
getConceptID() |
short |
getDepth() |
double |
getIntrinsicInfoContent() |
static ObjPair<ConcRel,java.lang.Integer> |
getLeastCommonConcept(ConcRel c1,
ConcRel c2)
Deprecated.
|
static int |
getLeastCommonConcept(ConcRel c1,
ConcRel c2,
java.util.Set<ConcRel> lcses,
java.util.Map<ConcRel,LCSPath> paths) |
int |
getNodeIndex() |
java.util.Set<ConcRel> |
getParents() |
int[] |
getParentsArray() |
void |
getPath(java.util.List<ConcRel> lpath,
java.util.List<java.util.List<ConcRel>> allPaths,
int depth,
int depthMax)
recursively build all paths to root from a concept - add elements from
set of parents.
|
boolean |
hasAncestor(java.lang.String cui)
is the specified concept an ancestor of this concept?
|
int |
hashCode() |
boolean |
isLeaf() |
boolean |
isRoot() |
private void |
readObject(java.io.ObjectInputStream in)
read parent/children concept ids, not the objects
|
private static void |
removeParents(java.util.HashSet<ConcRel> lcses,
java.util.HashSet<ConcRel> parents)
remove the parents of candidate lcses from the list of parents we were
planning on looking at in the next iteration
|
void |
setChildrenArray(int[] childrenArray) |
void |
setConceptID(java.lang.String nodeCUI) |
void |
setDepth(short depth) |
void |
setIntrinsicInfoContent(double intrinsicInfoContent) |
void |
setNodeIndex(int nodeIndex) |
void |
setParentsArray(int[] parentsArray) |
java.lang.String |
toString() |
private static void |
updateParent(java.util.Map<ConcRel,java.lang.Integer> cand1,
java.util.HashSet<ConcRel> parC1,
java.util.HashSet<ConcRel> tmp,
int dist,
java.util.Map<ConcRel,java.util.List<ConcRel>> paths)
perform 1 iteration of breadth-first search on lcs.
|
private void |
writeObject(java.io.ObjectOutputStream out)
serialize parent/children concept ids, not the objects
|
private static final java.util.logging.Logger log
private static final long serialVersionUID
private java.util.Set<ConcRel> children
private int[] childrenArray
private short depth
private double intrinsicInfoContent
private java.lang.String nodeCUI
private int nodeIndex
private java.util.Set<ConcRel> parents
private int[] parentsArray
public static java.util.List<java.lang.String> crListToString(java.util.List<ConcRel> crList)
public static ObjPair<ConcRel,java.lang.Integer> getLeastCommonConcept(ConcRel c1, ConcRel c2)
c1
- c2
- public static int getLeastCommonConcept(ConcRel c1, ConcRel c2, java.util.Set<ConcRel> lcses, java.util.Map<ConcRel,LCSPath> paths)
c1
- concept1c2
- concept2lcses
- least common subsumers, requiredpaths
- paths between concepts via lcses, optional. Key - lcs. Value -
2 element list corresponding to paths to lcs from c1 and c2private static void removeParents(java.util.HashSet<ConcRel> lcses, java.util.HashSet<ConcRel> parents)
lcses
- parents
- private static void updateParent(java.util.Map<ConcRel,java.lang.Integer> cand1, java.util.HashSet<ConcRel> parC1, java.util.HashSet<ConcRel> tmp, int dist, java.util.Map<ConcRel,java.util.List<ConcRel>> paths)
cand1
- parC1
- tmp
- dist
- public void constructRel(java.util.List<ConcRel> db)
db
- public int depthMax()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.util.Set<ConcRel> getChildren()
public int[] getChildrenArray()
public java.lang.String getConceptID()
public short getDepth()
public double getIntrinsicInfoContent()
public int getNodeIndex()
public java.util.Set<ConcRel> getParents()
public int[] getParentsArray()
public void getPath(java.util.List<ConcRel> lpath, java.util.List<java.util.List<ConcRel>> allPaths, int depth, int depthMax)
lpath
- current path from children to this conceptallPaths
- list of all pathsdepth
- current depthdepthMax
- public boolean hasAncestor(java.lang.String cui)
cui
- public int hashCode()
hashCode
in class java.lang.Object
public boolean isLeaf()
public boolean isRoot()
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void setChildrenArray(int[] childrenArray)
public void setConceptID(java.lang.String nodeCUI)
public void setDepth(short depth)
public void setIntrinsicInfoContent(double intrinsicInfoContent)
public void setNodeIndex(int nodeIndex)
public void setParentsArray(int[] parentsArray)
public java.lang.String toString()
toString
in class java.lang.Object
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException