public int compare(Timer o1, Timer o2) { if( sortBy.equalsIgnoreCase( "Total" ) ) { long t1 = o1.getTotal(); long t2 = o2.getTotal(); if( t1 == 0 ) t1 = o1.getElapsed(); if( t2 == 0 ) t2 = o2.getElapsed(); return (int)(t2 -t1); } else if( sortBy.equalsIgnoreCase( "Avg" ) ) return (int)(o2.getAverage() - o1.getAverage()); else if( sortBy.equalsIgnoreCase( "Count" ) ) return (int)(o2.getCount() - o1.getCount()); else return AlphaNumericComparator.CASE_INSENSITIVE.compare( o1, o2 ); } });
public int compare(Timer o1, Timer o2) { if( sortBy.equalsIgnoreCase( "Total" ) ) { long t1 = o1.getTotal(); long t2 = o2.getTotal(); if( t1 == 0 ) t1 = o1.getElapsed(); if( t2 == 0 ) t2 = o2.getElapsed(); return (int)(t2 -t1); } else if( sortBy.equalsIgnoreCase( "Avg" ) ) return (int)(o2.getAverage() - o1.getAverage()); else if( sortBy.equalsIgnoreCase( "Count" ) ) return (int)(o2.getCount() - o1.getCount()); else return AlphaNumericComparator.CASE_INSENSITIVE.compare( o1, o2 ); } });
row.add(timer.getName()); if(!shortForm) { row.add(String.valueOf(timer.getCount())); row.add(nf.format(timer.getAverage()));
row.add(timer.getName()); if(!shortForm) { row.add(String.valueOf(timer.getCount())); row.add(nf.format(timer.getAverage()));
public boolean isSubClassOf(ATermAppl c1, ATermAppl c2) { if( !doExplanation ) { Bool isKnownSubClass = isKnownSubClassOf( c1, c2 ); if( isKnownSubClass.isKnown() ) { return isKnownSubClass.isTrue(); } } if( log.isLoggable( Level.FINE ) ) { long count = kb.timers.getTimer( "subClassSat" ) == null ? 0 : kb.timers.getTimer( "subClassSat" ).getCount(); log.fine( count + ") Checking subclass [" + ATermUtils.toString( c1 ) + " " + ATermUtils.toString( c2 ) + "]" ); } ATermAppl notC2 = ATermUtils.negate( c2 ); ATermAppl c = ATermUtils.makeAnd( c1, notC2 ); Timer t = kb.timers.startTimer( "subClassSat" ); boolean sub = !isSatisfiable( c, false ); t.stop(); if( log.isLoggable( Level.FINE ) ) { log.fine( " Result: " + sub + " (" + t.getLast() + "ms)" ); } return sub; }
public boolean isSubClassOf(ATermAppl c1, ATermAppl c2) { if( !doExplanation ) { Bool isKnownSubClass = isKnownSubClassOf( c1, c2 ); if( isKnownSubClass.isKnown() ) { return isKnownSubClass.isTrue(); } } if( log.isLoggable( Level.FINE ) ) { long count = kb.timers.getTimer( "subClassSat" ) == null ? 0 : kb.timers.getTimer( "subClassSat" ).getCount(); log.fine( count + ") Checking subclass [" + ATermUtils.toString( c1 ) + " " + ATermUtils.toString( c2 ) + "]" ); } ATermAppl notC2 = ATermUtils.negate( c2 ); ATermAppl c = ATermUtils.makeAnd( c1, notC2 ); Timer t = kb.timers.startTimer( "subClassSat" ); boolean sub = !isSatisfiable( c, false ); t.stop(); if( log.isLoggable( Level.FINE ) ) { log.fine( " Result: " + sub + " (" + t.getLast() + "ms)" ); } return sub; }