From 9f9e44bada8d052d264ec7efa09beaa2a1123db0 Mon Sep 17 00:00:00 2001 From: dev <dev@robertfoss.se> Date: Tue, 7 Jun 2011 20:54:40 +0000 Subject: [PATCH] Improved toString() and formatting. --- .../freenet/support/CPUInformation/CPUID.java | 22 +++++++++---------- .../support/CPUInformation/IntelCPUInfo.java | 12 ++++++++++ 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/core/java/src/freenet/support/CPUInformation/CPUID.java b/core/java/src/freenet/support/CPUInformation/CPUID.java index b87fde6f0b..749ac4525c 100644 --- a/core/java/src/freenet/support/CPUInformation/CPUID.java +++ b/core/java/src/freenet/support/CPUInformation/CPUID.java @@ -476,25 +476,23 @@ public class CPUID { // Remove when implemented isCore7Compatible in BigInteger } else if (getCPUExtendedModel() == 0 && getCPUFamily() == 6 && getCPUModel() == 15){ return true; - } else { - return false; } + return false; } public boolean IsAtomCompatible() { if (getCPUExtendedModel() == 0 && getCPUFamily() == 6 && getCPUModel() == 12){ return true; - } else { - return false; - } + } + return false; + } public boolean IsCore2Compatible() { if (getCPUExtendedModel() == 0 && getCPUFamily() == 6 && getCPUModel() == 15){ return true; - } else { - return false; - } + } + return false; } public boolean IsCoreiCompatible() { @@ -503,9 +501,8 @@ public class CPUID { // Xeon MP (45nm) or Core i7 } else if (getCPUExtendedModel() == 1 && (getCPUFamily() == 6 && (getCPUModel() == 10 || getCPUModel() == 13 || getCPUModel() == 14))){ return true; - } else { - return false; - } + } + return false; } public String getCPUModelString() throws UnknownCPUException { if (getCPUExtendedModel() == 0){ @@ -668,6 +665,9 @@ public class CPUID { System.out.println(" Is pII-compatible: "+((IntelCPUInfo)c).IsPentium2Compatible()); System.out.println(" Is pIII-compatible: "+((IntelCPUInfo)c).IsPentium3Compatible()); System.out.println(" Is pIV-compatible: "+((IntelCPUInfo)c).IsPentium4Compatible()); + System.out.println(" Is atom-compatible: "+((IntelCPUInfo)c).IsAtomCompatible()); + System.out.println(" Is core2-compatible: "+((IntelCPUInfo)c).IsCore2Compatible()); + System.out.println(" Is corei-compatible: "+((IntelCPUInfo)c).IsCoreiCompatible()); } if(c instanceof AMDCPUInfo){ System.out.println(" **AMD-info**"); diff --git a/core/java/src/freenet/support/CPUInformation/IntelCPUInfo.java b/core/java/src/freenet/support/CPUInformation/IntelCPUInfo.java index 20f8aaf77e..a333b63e5b 100644 --- a/core/java/src/freenet/support/CPUInformation/IntelCPUInfo.java +++ b/core/java/src/freenet/support/CPUInformation/IntelCPUInfo.java @@ -37,4 +37,16 @@ public interface IntelCPUInfo extends CPUInfo { * @return true iff the CPU implements at least a Pentium IV level instruction/feature set. */ public boolean IsPentium4Compatible(); + /** + * @return true iff the CPU implements at least a Atom level instruction/feature set. + */ + public boolean IsAtomCompatible(); + /** + * @return true iff the CPU implements at least a Core2 level instruction/feature set. + */ + public boolean IsCore2Compatible(); + /** + * @return true iff the CPU implements at least a Corei level instruction/feature set. + */ + public boolean IsCoreiCompatible(); } -- GitLab