This HTML5 document contains 4 embedded RDF statements represented using HTML+Microdata notation.

The embedded RDF content will be recognized by any processor of HTML5 Microdata.

PrefixNamespace IRI
n6http://dbkwik.webdatacommons.org/ontology/
dctermshttp://purl.org/dc/terms/
n5http://dbkwik.webdatacommons.org/resource/uAbK6RkFDyNpwOArQswYqQ==
rdfshttp://www.w3.org/2000/01/rdf-schema#
n2http://dbkwik.webdatacommons.org/resource/9CCLf8dHAn9tuAalp1HVkg==
rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#
xsdhhttp://www.w3.org/2001/XMLSchema#
Subject Item
n2:
rdfs:label
Bubble Sort of Tree Cells
rdfs:comment
In working with Trees in JavaFX, you might have a need to alpha sort child TreeCells in the event that a label is edited or a new tree cell is inserted. This example uses a simple Bubble Sort implementation to trigger the sort of TreeCells that are the child of the indicated parent. For this example, I am using a subclass of TreeCell that adopts a new operation called sortCells() which can be called upon it at any time. --Rcasey 00:18, 17 November 2007 (UTC)
dcterms:subject
n5:
n6:abstract
In working with Trees in JavaFX, you might have a need to alpha sort child TreeCells in the event that a label is edited or a new tree cell is inserted. This example uses a simple Bubble Sort implementation to trigger the sort of TreeCells that are the child of the indicated parent. For this example, I am using a subclass of TreeCell that adopts a new operation called sortCells() which can be called upon it at any time. public class MyTreeCell extends TreeCell { public operation sortCells(); // trigger sorting of child cells } operation MyTreeCell.sortCells() { if (sizeof this.cells > 1) { // bubble sort for (i in [0..(sizeof this.cells)-2]) { for (j in [(sizeof this.cells)-1..i+1]) { var cell1 = this.cells[j-1]; var cell2 = this.cells[j]; if (cell1.text.compareToIgnoreCase(cell2.text) > 0) { //swap( A[ j ], A[ j - 1 ] ) insert cell2 before this.cells[j-1]; delete this.cells[j+1]; } } } } } --Rcasey 00:18, 17 November 2007 (UTC)