SpeedLimitConfidencepublic class SpeedLimitConfidence extends Object implements ComparableCreated on Jun 5, 2007
Created by Alan Snyder
Copyright (C) 2007 Aelitis, All Rights Reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
AELITIS, SAS au capital de 63.529,40 euros
8 Allee Lenotre, La Grille Royale, 78600 Le Mesnil le Roi, France. |
Fields Summary |
---|
public static final SpeedLimitConfidence | NONE | public static final SpeedLimitConfidence | LOW | public static final SpeedLimitConfidence | MED | public static final SpeedLimitConfidence | HIGH | public static final SpeedLimitConfidence | ABSOLUTE | private final String | name | private final int | order | private final float | estimateType | private static final String | MESSAGE_BUNDLE_PREFIX |
Constructors Summary |
---|
private SpeedLimitConfidence(String _name, int _order, float _speedLimitEstimateType)
name = _name;
order = _order;
estimateType = _speedLimitEstimateType;
|
Methods Summary |
---|
public float | asEstimateType()
return estimateType;
| public static java.lang.String | asEstimateTypeString(float type)
//ToDo: move to proper class. This is to do something now.
if( type==SpeedManagerLimitEstimate.TYPE_UNKNOWN ){
return "Unknown";
}else if( type==SpeedManagerLimitEstimate.TYPE_ESTIMATED){
return "Estimate";
}else if( type==SpeedManagerLimitEstimate.TYPE_MANUAL){
return "Fixed";
}
return "";
| public int | compareTo(java.lang.Object obj)Comparable interface.
if( !(obj instanceof SpeedLimitConfidence) ){
throw new ClassCastException("Only comparable to SpeedLimitConfidence class.");
}
SpeedLimitConfidence casted = (SpeedLimitConfidence) obj;
return compareTo(casted);
| public int | compareTo(com.aelitis.azureus.core.speedmanager.impl.v2.SpeedLimitConfidence limitConf)Comparable interface
return (order - limitConf.order);
| public static com.aelitis.azureus.core.speedmanager.impl.v2.SpeedLimitConfidence | convertType(float type)
if( type <= SpeedLimitConfidence.NONE.estimateType ){
return NONE;
}else if( type <= SpeedLimitConfidence.LOW.estimateType ){
return LOW;
}else if( type <= SpeedLimitConfidence.MED.estimateType ){
return MED;
}else if( type <= SpeedLimitConfidence.HIGH.estimateType ){
return HIGH;
}else{
return ABSOLUTE;
}
| public java.lang.String | getInternationalizedString()Get the internationalized string for UI panels and
drop downs.
return MessageText.getString( MESSAGE_BUNDLE_PREFIX + name.toLowerCase() );
| public java.lang.String | getString()
return name;
| public boolean | isGreater(com.aelitis.azureus.core.speedmanager.impl.v2.SpeedLimitConfidence limitConf)compareTo to with boolean syntax.
if( this.compareTo(limitConf)>0 ){
return true;
}
return false;
| public static com.aelitis.azureus.core.speedmanager.impl.v2.SpeedLimitConfidence | parseString(java.lang.String setting)Turns a string into a SpeedLimitConfidence class.
SpeedLimitConfidence retVal = SpeedLimitConfidence.NONE;
if(setting==null){
return retVal;
}
if( "NONE".equalsIgnoreCase(setting) ){
return SpeedLimitConfidence.NONE;
}else if("LOW".equalsIgnoreCase(setting)){
return SpeedLimitConfidence.LOW;
}else if("MED".equalsIgnoreCase(setting)){
return SpeedLimitConfidence.MED;
}else if("HIGH".equalsIgnoreCase(setting)){
return SpeedLimitConfidence.HIGH;
}else if("ABSOLUTE".equalsIgnoreCase(setting)){
return SpeedLimitConfidence.ABSOLUTE;
}
return retVal;
|
|