|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmesquite.lib.Listened
mesquite.lib.Attachable
mesquite.lib.Associable
public abstract class Associable
A class that contains serially repeated parts, to each of which may be attached information. For example, a Tree contains many nodes, and information might be attached to each node. A Taxa contains taxons, a CharacterData contains characters, and so on. The purpose of this class is to coordinate this attached ("associated") information. Subclasses include FileElement (and thus CharacterData and Taxa) and Tree.
| Field Summary | |
|---|---|
protected java.lang.String |
comment
|
protected ObjectArray |
comments
The object array storing comments (e.g. |
protected int |
numParts
|
protected boolean |
rememberDefaultOrder
|
protected Bits |
selected
The bit field indicating which parts are selected currently. |
protected long |
versionNumber
A number recording the version number. |
| Fields inherited from class mesquite.lib.Listened |
|---|
allListeners, classes, classesNotified, listeners, listenersRemaining, notifications |
| Fields inherited from interface mesquite.lib.HTMLDescribable |
|---|
verbose |
| Constructor Summary | |
|---|---|
Associable()
|
|
Associable(int numParts)
|
|
| Method Summary | |
|---|---|
boolean |
addParts(int starting,
int num)
|
boolean |
anyAssociatedObject(NameReference nRef)
Returns true iff there is at least one associate object of type nRef |
boolean |
anySelected()
Returns whether there are any selected parts |
void |
clearAllAssociatedBits(NameReference nRef)
|
boolean |
contiguousSelection()
Returns whether there are selected parts that form a contiguous selection |
boolean |
contiguousSelectionOld()
Returns whether there are selected parts that form a contiguous selection. |
void |
copyCurrentToPreviousOrder()
|
void |
deassignAllAssociatedLongs(NameReference nRef)
|
void |
deassignAssociated()
|
void |
deassignAssociated(int node)
|
void |
deleteJustAdded()
|
boolean |
deleteParts(int starting,
int num)
|
void |
deselectAll()
Deselects all parts |
void |
dispose()
Disposes this associable |
java.lang.Object |
doCommand(java.lang.String commandName,
java.lang.String arguments,
CommandChecker checker)
For Commandable interface. |
void |
equalizeParts(Associable other,
int otherPart,
int part)
|
void |
exchangeAssociated(int node1,
int node2)
|
int |
firstSelected()
Returns index of first selected part |
java.lang.String |
getAnnotation()
Returns the comment (e.g., footnote) of this element |
java.lang.String |
getAnnotation(int part)
Returns whether the part is selected |
boolean |
getAssociatedBit(NameReference nRef,
int index)
|
Bits |
getAssociatedBits(int index)
|
double |
getAssociatedDouble(NameReference nRef,
int index)
|
DoubleArray |
getAssociatedDoubles(int index)
|
long |
getAssociatedLong(NameReference nRef,
int index)
|
LongArray |
getAssociatedLongs(int index)
|
java.lang.Object |
getAssociatedObject(NameReference nRef,
int index)
|
ObjectArray |
getAssociatedObjects(int index)
|
int |
getDefaultPosition(int part)
|
boolean |
getDirty()
Returns whether the element is dirty (changed since last file save) or not |
boolean |
getJustAdded(int part)
|
int |
getNumberAssociatedBits()
|
int |
getNumberAssociatedDoubles()
|
int |
getNumberAssociatedLongs()
|
int |
getNumberAssociatedObjects()
|
int |
getNumberOfParts()
|
int |
getNumberOfSelectableParts()
Returns number of parts that can be selected |
boolean |
getSelected(int part)
Returns whether the part is selected |
Bits |
getSelectedBits()
Returns selected directly |
Snapshot |
getSnapshot(MesquiteFile file)
|
long |
getVersionNumber()
Returns version number of Associable. |
Bits |
getWhichAssociatedBits(NameReference nRef)
|
DoubleArray |
getWhichAssociatedDouble(NameReference nRef)
|
LongArray |
getWhichAssociatedLong(NameReference nRef)
|
ObjectArray |
getWhichAssociatedObject(NameReference nRef)
|
protected boolean |
inBounds(int part)
Returns true if part is within bounds. |
int |
lastSelected()
Returns index of last selected part |
java.lang.String |
listAssociates()
|
NameReference |
makeAssociatedBits(java.lang.String name)
|
NameReference |
makeAssociatedDoubles(java.lang.String name)
|
NameReference |
makeAssociatedLongs(java.lang.String name)
|
NameReference |
makeAssociatedObjects(java.lang.String name)
|
boolean |
moveParts(int starting,
int num,
int justAfter)
|
int |
numberSelected()
Returns number of selected parts |
int |
numberSelected(boolean onlyCountSelected)
returns number of parts that are selected or, if onlyCountSelected is false, all parts |
void |
readAssociated(java.lang.String assocString,
int node,
MesquiteInteger pos)
|
void |
recordCurrentOrder()
|
protected void |
recordDefaultOrder()
|
void |
recordPreviousOrder()
|
void |
removeAssociatedBits(NameReference nRef)
|
void |
removeAssociatedDoubles(NameReference nRef)
|
void |
removeAssociatedLongs(NameReference nRef)
|
void |
removeAssociatedObjects(NameReference nRef)
|
void |
resetDefaultOrderToCurrent()
|
void |
resetJustAdded()
|
void |
restoreToPreviousOrder()
|
void |
selectAll()
Selects all parts |
void |
setAnnotation(int part,
java.lang.String comment)
Sets the comment for a part |
void |
setAnnotation(java.lang.String e,
boolean notify)
Sets the comment (e.g., footnote) of this element |
void |
setAssociatedBit(NameReference nRef,
int index,
boolean value)
|
void |
setAssociatedDouble(NameReference nRef,
int index,
double value)
|
void |
setAssociatedLong(NameReference nRef,
int index,
long value)
|
void |
setAssociatedObject(NameReference nRef,
int index,
java.lang.Object value)
|
void |
setAssociateds(Associable a)
|
void |
setDefaultPosition(int part,
int position)
|
void |
setDirty(boolean d)
Sets the element as dirty (changed since last file save) or not |
void |
setJustAdded(int part,
boolean b)
|
void |
setNumberOfParts(int num)
Set the number of parts to given number. |
void |
setSelected(int part,
boolean select)
Sets whether or not the part is selected |
boolean |
swapParts(int first,
int second)
|
java.lang.String |
toHTMLStringDescription()
|
void |
transferAssociated(int fromNode,
int toNode)
|
java.lang.String |
writeAssociated(int node,
boolean associatedUseComments)
|
void |
zeroAllAssociatedDoubles(NameReference nRef)
|
void |
zeroAllAssociatedLongs(NameReference nRef)
|
void |
zeroAllAssociatedObjects(NameReference nRef)
|
| Methods inherited from class mesquite.lib.Attachable |
|---|
anyAttachments, attach, attachIfUniqueName, detach, getAttachment, getAttachment, getAttachments, listAttachments, readAttachments, setAttachments, writeAttachments |
| Methods inherited from class mesquite.lib.Listened |
|---|
addListener, addListenerHighPriority, amIListening, decrementNotifySuppress, doAfterNotify, getRemainingListeners, incrementNotifySuppress, listListeners, notifyDisposing, notifyListeners, notifyListeners, removeListener, reportListeners, setDumpNotified |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface mesquite.lib.Listable |
|---|
getName |
| Methods inherited from interface mesquite.lib.Listenable |
|---|
addListener, addListenerHighPriority, amIListening, decrementNotifySuppress, incrementNotifySuppress, listListeners, notifyListeners, removeListener |
| Field Detail |
|---|
protected int numParts
protected boolean rememberDefaultOrder
protected long versionNumber
protected java.lang.String comment
protected Bits selected
protected ObjectArray comments
| Constructor Detail |
|---|
public Associable(int numParts)
public Associable()
| Method Detail |
|---|
public void dispose()
dispose in class Attachablepublic java.lang.String toHTMLStringDescription()
toHTMLStringDescription in interface HTMLDescribabletoHTMLStringDescription in class Attachable
public void equalizeParts(Associable other,
int otherPart,
int part)
public void setJustAdded(int part,
boolean b)
public boolean getJustAdded(int part)
public void resetJustAdded()
public void deleteJustAdded()
protected void recordDefaultOrder()
public void recordCurrentOrder()
public void recordPreviousOrder()
public void copyCurrentToPreviousOrder()
public long getVersionNumber()
public int getNumberOfParts()
public Snapshot getSnapshot(MesquiteFile file)
public java.lang.Object doCommand(java.lang.String commandName,
java.lang.String arguments,
CommandChecker checker)
doCommand in interface Commandable
public void setAnnotation(java.lang.String e,
boolean notify)
setAnnotation in interface Annotatablepublic java.lang.String getAnnotation()
getAnnotation in interface Annotatablepublic void setDirty(boolean d)
public boolean getDirty()
protected boolean inBounds(int part)
public java.lang.String listAssociates()
public java.lang.String writeAssociated(int node,
boolean associatedUseComments)
public void readAssociated(java.lang.String assocString,
int node,
MesquiteInteger pos)
public void setAssociateds(Associable a)
public void transferAssociated(int fromNode,
int toNode)
public void exchangeAssociated(int node1,
int node2)
public void deassignAssociated(int node)
public void deassignAssociated()
public void setNumberOfParts(int num)
public boolean addParts(int starting,
int num)
public boolean deleteParts(int starting,
int num)
public boolean moveParts(int starting,
int num,
int justAfter)
public void restoreToPreviousOrder()
public boolean swapParts(int first,
int second)
public int getDefaultPosition(int part)
public void setDefaultPosition(int part,
int position)
public void resetDefaultOrderToCurrent()
public void setAnnotation(int part,
java.lang.String comment)
public java.lang.String getAnnotation(int part)
public int getNumberOfSelectableParts()
getNumberOfSelectableParts in interface Selectionable
public void setSelected(int part,
boolean select)
setSelected in interface Selectionablepublic boolean getSelected(int part)
getSelected in interface Selectionablepublic void deselectAll()
deselectAll in interface Selectionablepublic void selectAll()
selectAll in interface Selectionablepublic int firstSelected()
public int lastSelected()
public Bits getSelectedBits()
public boolean contiguousSelection()
public boolean contiguousSelectionOld()
public boolean anySelected()
anySelected in interface Selectionablepublic int numberSelected()
numberSelected in interface Selectionablepublic int numberSelected(boolean onlyCountSelected)
public int getNumberAssociatedBits()
public Bits getAssociatedBits(int index)
public NameReference makeAssociatedBits(java.lang.String name)
public void removeAssociatedBits(NameReference nRef)
public Bits getWhichAssociatedBits(NameReference nRef)
public void clearAllAssociatedBits(NameReference nRef)
public void setAssociatedBit(NameReference nRef,
int index,
boolean value)
public boolean getAssociatedBit(NameReference nRef,
int index)
public int getNumberAssociatedLongs()
public LongArray getAssociatedLongs(int index)
public NameReference makeAssociatedLongs(java.lang.String name)
public void removeAssociatedLongs(NameReference nRef)
public LongArray getWhichAssociatedLong(NameReference nRef)
public void deassignAllAssociatedLongs(NameReference nRef)
public void zeroAllAssociatedLongs(NameReference nRef)
public void setAssociatedLong(NameReference nRef,
int index,
long value)
public long getAssociatedLong(NameReference nRef,
int index)
public int getNumberAssociatedDoubles()
public DoubleArray getAssociatedDoubles(int index)
public NameReference makeAssociatedDoubles(java.lang.String name)
public void removeAssociatedDoubles(NameReference nRef)
public DoubleArray getWhichAssociatedDouble(NameReference nRef)
public void zeroAllAssociatedDoubles(NameReference nRef)
public void setAssociatedDouble(NameReference nRef,
int index,
double value)
public double getAssociatedDouble(NameReference nRef,
int index)
public int getNumberAssociatedObjects()
public ObjectArray getAssociatedObjects(int index)
public NameReference makeAssociatedObjects(java.lang.String name)
public void removeAssociatedObjects(NameReference nRef)
public ObjectArray getWhichAssociatedObject(NameReference nRef)
public void zeroAllAssociatedObjects(NameReference nRef)
public void setAssociatedObject(NameReference nRef,
int index,
java.lang.Object value)
public java.lang.Object getAssociatedObject(NameReference nRef,
int index)
public boolean anyAssociatedObject(NameReference nRef)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||