public class DyadTMap
extends java.util.TreeMap
implements java.io.Serializable
DyadTMap
contains a normal TreeMap and has 1 convenience method,
dyAdd
, which type-checks items added to the TreeMap
(only Dyad
s allowed) and stores them indexed by kin term & PCString.
The DyadTMap itself is a 2-level TMap: kinTerm -> pcString -> AList of Dyads.
It is where we store all the Dyads gathered for an entire context (language).
So all dyads for 'uncle' are stored under the index term 'uncle.'
Within the group of 'uncle' dyads, we further index them on kinType
(specifically on pcString). So all the 'uncle' dyads are indexed under
'FaBro' or 'MoBro'. Etc.Constructor and Description |
---|
DyadTMap() |
Modifier and Type | Method and Description |
---|---|
void |
assimlate(DyadTMap otherMap)
Integrate all the dyads in
otherMap into this one. |
int |
avgDyadsPerPCStr(java.lang.String kTerm) |
DyadTMap |
convertToAdr() |
DyadTMap |
deepCopy() |
void |
dyAdd(Dyad item)
Add this Dyad to the TreeMap.
|
void |
dyAddOrUpdate(Dyad item)
If this dyad is already present, replace with this one.
|
java.util.ArrayList<Dyad> |
findDyadList(Dyad dy) |
void |
purgeDyads(int personNmbr)
Iterate thru all dyads, removing any that refer to a person with
this serial number or higher.
|
java.lang.Object |
put(java.lang.String key,
java.util.TreeMap subTree)
A special put method that overrides
TreeMap 's method; it adjusts total . |
java.lang.Object |
remove(java.lang.String key)
A special remove method that overrides
TreeMap 's method; it adjusts total . |
void |
removeDyad(DomainTheory dt,
int egoInt,
int alterInt,
java.lang.String term,
java.lang.String pcString) |
java.lang.String |
summaryString()
summaryString builds a printable table of the contents . |
java.lang.String |
toSILKString()
This method builds a string that represents a DyadTMap in a SILKin data (_.silk) file.
|
int |
total() |
ceilingEntry, ceilingKey, clear, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, get, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, remove, size, subMap, subMap, tailMap, tailMap, values
public DyadTMap deepCopy()
public int total()
public void dyAdd(Dyad item)
item
- the Dyad to be added.public void dyAddOrUpdate(Dyad item)
item
- the Dyad to be inserted.public java.lang.Object remove(java.lang.String key)
TreeMap
's method; it adjusts total
.key
- the key for the sub-tree to be removed.public java.lang.Object put(java.lang.String key, java.util.TreeMap subTree)
TreeMap
's method; it adjusts total
.
If there is a prior sub-tree associated with key
, it is replaced with the new one.
The number of dyads in the prior sub-tree is subtracted from total
before the
number in the new one is added.key
- the key for the sub-tree to be put into this TreeMap.subTree
- the sub-tree to be inserted.public void removeDyad(DomainTheory dt, int egoInt, int alterInt, java.lang.String term, java.lang.String pcString)
public void purgeDyads(int personNmbr)
personNmbr
- the lowest serial number to be purgedpublic void assimlate(DyadTMap otherMap)
otherMap
into this one.otherMap
- the DyadTMap to be assimilated.public DyadTMap convertToAdr()
public java.lang.String toSILKString()
public java.lang.String summaryString() throws KSInternalErrorException
summaryString
builds a printable table of the contents .KSInternalErrorException
public int avgDyadsPerPCStr(java.lang.String kTerm)