<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.twig.es/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.twig.es/index.php?action=history&amp;feed=atom&amp;title=SumAll.java</id>
		<title>SumAll.java - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.twig.es/index.php?action=history&amp;feed=atom&amp;title=SumAll.java"/>
		<link rel="alternate" type="text/html" href="https://wiki.twig.es/index.php?title=SumAll.java&amp;action=history"/>
		<updated>2026-05-06T14:46:56Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.0</generator>

	<entry>
		<id>https://wiki.twig.es/index.php?title=SumAll.java&amp;diff=3447&amp;oldid=prev</id>
		<title>George2 at 18:25, 27 June 2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.twig.es/index.php?title=SumAll.java&amp;diff=3447&amp;oldid=prev"/>
				<updated>2016-06-27T18:25:19Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 18:25, 27 June 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt; source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;public class SumAll&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;public class SumAll&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>George2</name></author>	</entry>

	<entry>
		<id>https://wiki.twig.es/index.php?title=SumAll.java&amp;diff=3446&amp;oldid=prev</id>
		<title>George2: Created page with &quot;&lt; source lang=&quot;java&quot;&gt; public class SumAll { /// Class to recieve three strings from calling program and summing up all the disk space figures // Variables String totalSpace; /...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.twig.es/index.php?title=SumAll.java&amp;diff=3446&amp;oldid=prev"/>
				<updated>2016-06-27T18:24:52Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt; source lang=&amp;quot;java&amp;quot;&amp;gt; public class SumAll { /// Class to recieve three strings from calling program and summing up all the disk space figures // Variables String totalSpace; /...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt; source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class SumAll&lt;br /&gt;
{&lt;br /&gt;
/// Class to recieve three strings from calling program and summing up all the disk space figures&lt;br /&gt;
// Variables&lt;br /&gt;
String totalSpace; // these three are inputs&lt;br /&gt;
String usedSpace;&lt;br /&gt;
String freeSpace;&lt;br /&gt;
float totalSum =  0.1f ;  // these three are the ouptut&lt;br /&gt;
float usedSum  = 0.1f ;&lt;br /&gt;
float freeSum  = 0.1f ;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void initialise()  // This will reset all of the input and output counters to zero&lt;br /&gt;
          {&lt;br /&gt;
          totalSpace = &amp;quot;&amp;quot;;&lt;br /&gt;
          usedSpace = &amp;quot;&amp;quot;;&lt;br /&gt;
          freeSpace = &amp;quot;&amp;quot;;&lt;br /&gt;
          totalSum = 0;&lt;br /&gt;
          usedSum = 0;&lt;br /&gt;
          freeSum = 0;&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
void addThis(String tot,String used,String free)&lt;br /&gt;
                                               {&lt;br /&gt;
                                               String _tot = tot;&lt;br /&gt;
                                               String _used = used;&lt;br /&gt;
                                               String _free = free;&lt;br /&gt;
                                               char unit ;&lt;br /&gt;
                                               String value ;&lt;br /&gt;
                                               float longValue = 0 ;&lt;br /&gt;
&lt;br /&gt;
                                               // first the tot&lt;br /&gt;
                                               // We have to convert the strings to bytes, find last char, B,K,G,T and multiply appropriately&lt;br /&gt;
                                               // Example code : str.charAt(str.length() - 1)&lt;br /&gt;
                   // System.out.println(&amp;quot;the string is &amp;quot; + _tot + &amp;quot; and the length is &amp;quot; + _tot.length());&lt;br /&gt;
                                               unit = _tot.charAt(_tot.length() -1 );   // This gets the last character to see what the units are&lt;br /&gt;
                                               // Example str = str.substring(0, str.length()-1);  // to get all but the last character&lt;br /&gt;
                                               value = _tot.substring(0, _tot.length()-1);&lt;br /&gt;
                                               // Example Long.parseLong(numberAsString);&lt;br /&gt;
                                               // Use some if statements to decide the mulitplier&lt;br /&gt;
                                               /// Run the if statements&lt;br /&gt;
                                               // Examples&lt;br /&gt;
                                              // float f = Float.parseFloat(&amp;quot;25&amp;quot;);&lt;br /&gt;
                                              // String s = Float.toString(25.0f);&lt;br /&gt;
                                               if ( unit == 'B' ) {  longValue = Float.parseFloat(value); }&lt;br /&gt;
                                                 else if ( unit == 'K' ) { longValue = Float.parseFloat(value) * 1000 ; }&lt;br /&gt;
                                                 else if ( unit == 'G' ) { longValue = Float.parseFloat(value) * 1000 * 1000 ; }&lt;br /&gt;
                                                 else if ( unit == 'T' ) { longValue = Float.parseFloat(value) * 1000 * 1000 * 1000 ; }&lt;br /&gt;
                                                totalSum = totalSum + longValue;&lt;br /&gt;
                                              //  System.out.println(&amp;quot;the current sum is : &amp;quot; + totalSum);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                                               // Now used&lt;br /&gt;
                                               // We have to convert the strings to bytes, find last char, B,K,G,T and multiply appropriately&lt;br /&gt;
                                               // Example code : str.charAt(str.length() - 1)&lt;br /&gt;
 &lt;br /&gt;
                                               unit = _used.charAt(_used.length() -1 );   // This gets the last character to see what the units are&lt;br /&gt;
                                               // Example str = str.substring(0, str.length()-1);  // to get all but the last character&lt;br /&gt;
                                               value = _used.substring(0, _used.length()-1);&lt;br /&gt;
                                               // Example Long.parseLong(numberAsString);&lt;br /&gt;
                                               // Use some if statements to decide the mulitplier&lt;br /&gt;
                                               /// Run the if statements&lt;br /&gt;
                                               if ( unit == 'B' ) {  longValue = Long.parseLong(value); }&lt;br /&gt;
                                                 else if ( unit == 'K' ) { longValue = Float.parseFloat(value) * 1000 ; }&lt;br /&gt;
                                                 else if ( unit == 'G' ) { longValue = Float.parseFloat(value) * 1000 * 1000 ; }&lt;br /&gt;
                                                 else if ( unit == 'T' ) { longValue = Float.parseFloat(value) * 1000 * 1000 * 1000 ; }&lt;br /&gt;
                                                usedSum = usedSum + longValue;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                                               // Now free&lt;br /&gt;
                                               // We have to convert the strings to bytes, find last char, B,K,G,T and multiply appropriately&lt;br /&gt;
                                               // Example code : str.charAt(str.length() - 1)&lt;br /&gt;
                                               unit = _free.charAt(_free.length() -1 );   // This gets the last character to see what the units are&lt;br /&gt;
                                               // Example str = str.substring(0, str.length()-1);  // to get all but the last character&lt;br /&gt;
                                               value = _free.substring(0, _free.length()-1);&lt;br /&gt;
                                               // Example Long.parseLong(numberAsString);&lt;br /&gt;
                                               // Use some if statements to decide the mulitplier&lt;br /&gt;
                                               /// Run the if statements&lt;br /&gt;
                                               if ( unit == 'B' ) {  longValue = Long.parseLong(value); }&lt;br /&gt;
                                                 else if ( unit == 'K' ) { longValue = Float.parseFloat(value) * 1000 ; }&lt;br /&gt;
                                                 else if ( unit == 'G' ) { longValue = Float.parseFloat(value) * 1000 * 1000 ; }&lt;br /&gt;
                                                 else if ( unit == 'T' ) { longValue = Float.parseFloat(value) * 1000 * 1000 * 1000 ; }&lt;br /&gt;
                                                freeSum = freeSum + longValue;&lt;br /&gt;
                                               }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
String returnStuff(String s )&lt;br /&gt;
                            {       // s can be SUM, TOT or FREE&lt;br /&gt;
                            if ( s.equals(&amp;quot;SUM&amp;quot;)) {  // Create a nice human readable string from the long int for sum&lt;br /&gt;
                            &lt;br /&gt;
                                                     long tempSum = (long)totalSum/1000000 ;&lt;br /&gt;
                                                     //int tempSum = (int)totalSum ;&lt;br /&gt;
                                                    /// System.out.println(&amp;quot;the tempsum is &amp;quot; + tempSum);&lt;br /&gt;
                                                     String SUM;&lt;br /&gt;
                                                     // Examples&lt;br /&gt;
                                                            //    String.valueOf(number) (my preference)&lt;br /&gt;
                                                            //    Integer.toString(number)&lt;br /&gt;
                                                            SUM = String.valueOf(tempSum)+&amp;quot;G&amp;quot;;&lt;br /&gt;
                                                           //// System.out.println(&amp;quot;returning the return value of : &amp;quot; + SUM);&lt;br /&gt;
                                                            return SUM;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                                                  }&lt;br /&gt;
                                                  &lt;br /&gt;
                            if ( s.equals(&amp;quot;TOT&amp;quot;)) {  // Create a nice human readable string from the long int for total&lt;br /&gt;
                            &lt;br /&gt;
                                                     long tempSum = (long)usedSum/1000000 ;&lt;br /&gt;
                                                     ////System.out.println(&amp;quot;the tempsum is &amp;quot; + tempSum);&lt;br /&gt;
                                                     String TOT;&lt;br /&gt;
                                                     // Examples&lt;br /&gt;
                                                            //    String.valueOf(number) (my preference)&lt;br /&gt;
                                                            //    Integer.toString(number)&lt;br /&gt;
                                                            TOT = String.valueOf(tempSum)+&amp;quot;G&amp;quot;;&lt;br /&gt;
                                                          ////  System.out.println(&amp;quot;returning the return value of : &amp;quot; + TOT);&lt;br /&gt;
                                                            return TOT;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                                                  }                                                 &lt;br /&gt;
                                                  &lt;br /&gt;
                            if ( s.equals(&amp;quot;FREE&amp;quot;)) {  // Create a nice human readable string from the long int for total&lt;br /&gt;
                            &lt;br /&gt;
                                                     long tempSum = (long)freeSum/1000000 ;&lt;br /&gt;
                                                   ////  System.out.println(&amp;quot;the tempsum is &amp;quot; + tempSum);&lt;br /&gt;
                                                     String FREE;&lt;br /&gt;
                                                     // Examples&lt;br /&gt;
                                                            //    String.valueOf(number) (my preference)&lt;br /&gt;
                                                            //    Integer.toString(number)&lt;br /&gt;
                                                            FREE = String.valueOf(tempSum)+&amp;quot;G&amp;quot;;&lt;br /&gt;
                                                          ///  System.out.println(&amp;quot;returning the return value of : &amp;quot; + FREE);&lt;br /&gt;
                                                            return FREE;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                                                  }                     &lt;br /&gt;
                                                  &lt;br /&gt;
                                                  &lt;br /&gt;
                                                  &lt;br /&gt;
                                                  &lt;br /&gt;
                                                  &lt;br /&gt;
                            return &amp;quot;asdf&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>George2</name></author>	</entry>

	</feed>