Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: what is -xlint message?

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default what is -xlint message?

    Please, help me with my code. I want to do merge sort from simple user input, but keeps show "-Xlint ..." when compile it. Also, it's not working as expected...

     
    import java.util.*;
    import java.io.*;
    //import java.util.StringTokenizer;
     
    /**
     *
     * @author rus.ardhiyanto
     */
     
    public class SDA1 {
     
        private static String Sip = " Sender ";
        private static String Jam = " Clock ";
        private static String Judul = " Subject ";
     
        public static void main(String args[]) {
     
            String [] no = new String [3];
     
            try  {
                System.out.println("Sender Subject Clock");
                System.out.println();
     
                InputStreamReader input = new InputStreamReader(System.in);
                BufferedReader baca = new BufferedReader (input);
     
                String urut = new String ();
                String sender = new String ();
                String time = new String ();
                String subject = new String ();
     
                List <Email> imel = new ArrayList <Email> ();
     
                if ((urut = baca.readLine()) != null) {
                    no = urut.split("  ");
                }
     
                while ((urut = baca.readLine()) != null) {
                    StringTokenizer token = new StringTokenizer(urut);
                    sender = token.nextToken();
                    time = token.nextToken();
                    subject = " ";
     
                    while (token.hasMoreTokens()) {
                        subject += token.nextToken();
                    }
     
                    Clock hour = new Clock (time);
                    imel.add (new Email(sender, hour, subject));
                }
            Sortir sortir = new Sortir ();
            String[] strTemp = new String[imel.size()];
            String strTem = " ";
     
            for (int i = 0; i < imel.size(); i++) {
                for (int j = 0; j < no.length; j++) {
                    if (no[j].equals(Sip)) {
                        strTem += imel.get(i).getSender() + " ";
                    }
                    else if (no[j].equals(Jam)) {
                        strTem += imel.get(i).getClock().toString() + " ";
                    }
                    else if (no[j].equals(Judul))  {
                        strTem += imel.get(i).getSubject() +" ";
                    }
                }
                strTemp[i] = strTem;
                strTem = " ";
            }
     
            sortir.mergeSort(strTemp);
     
            for (int i = 0; i < imel.size(); i++) {
                System.out.println(strTemp[i]);
            }
     
            }
            catch
                    (Exception ex) {
            }
        }
    }
     
     
    class Sortir {
        List getSortbySender(List Email) {
            List ListTemp = null;
            return ListTemp;
        }
     
        private void merge (Comparable[] a, Comparable[] tmpArray, int Kiri, int Kanan, int KananPol) {
            int KiriAbis = Kanan - 1;
            int tmpPos = Kiri;
            int jmlElements = KananPol - Kiri + 1;
     
            while (Kiri <= KiriAbis && Kanan <= KananPol) {
                if (a[Kiri].compareTo(a[Kanan]) <= 0) {
                    tmpArray[tmpPos++] = a[Kiri++];
                }
                else {
                    tmpArray[tmpPos++] = a[Kanan++];
                }
            }
     
            while (Kanan <= Kiri) {
                tmpArray[tmpPos++] = a[Kiri++];
            }
     
            while (Kanan <= Kiri) {
                tmpArray[tmpPos++] = a[Kanan++];
            }
     
            for (int i = 0; i < jmlElements; i++, KananPol--) {
                a[KananPol] = tmpArray[KiriAbis];
            }
    }
     
        private void mergeSort (Comparable[] a, Comparable[] tmpArray, int kiri, int kanan) {
            if (kiri < kanan) {
                int tengah = (kiri + kanan) / 2;
                mergeSort (a, tmpArray, kiri, tengah);
                mergeSort (a, tmpArray, tengah + 1, kanan);
                merge(a, tmpArray, kiri, tengah + 1, kanan);
            }
        }
     
        public void mergeSort (Comparable a[]) {
            Comparable[] tmpArray = new Comparable[a.length];
            mergeSort(a, tmpArray, 0, a.length - 1);
        }
    }
     
    class Email {
    	private String sender;
    	private String subject;
    	private Clock clock;
     
     
    	Email(String sender, Clock clock, String subject) {
    		this.sender = sender;
    		this.clock = clock;
    		this.subject = subject;
    	}
     
    	String getSender() {
    		return sender;
    	}
     
    	void setSender(String sender) {
    		this.sender = sender;
    	}
     
    	String getSubject() {
    		return subject;
    	}
     
    	void setSubject(String subject) {
    		this.subject = subject;
    	}
     
    	Clock getClock() {
    		return clock;
    	}
     
    	void setClock(Clock clock) {
    		this.clock = clock;
    	}
     
        @Override
    	public String toString() {
    		return sender + " " + clock + " " + subject;
    	}
    }
     
     
    class Clock {
    	private Integer hour;
    	private Integer minute;
     
     
    	Clock(String time) {
    		StringTokenizer tok = new StringTokenizer(time, ":");
    		hour = Integer.parseInt(tok.nextToken());
    		minute = Integer.parseInt(tok.nextToken());
    	}
     
    	Integer getHour() {
    		return hour;
    	}
     
    	void setHour(Integer hour) {
    		this.hour = hour;
    	}
     
    	Integer getMinute() {
    		return minute;
    	}
     
    	void setMinute(Integer minute) {
    		this.minute = minute;
    	}
     
        @Override
    	public String toString() {
    		String out = "";
    		if (hour < 10) {
    			out += "0" + hour;
    		} else  {
    			out += hour;
    		}
    		out += " ";
    		if (minute < 10)  {
    			out += "0" + minute;
    		} else  {
    			out += minute;
    		}
    		return out;
    	}
    }

    thank you
    Last edited by rush7610; October 26th, 2011 at 01:16 PM.


  2. #2
    Forum VIP
    Join Date
    Oct 2010
    Posts
    275
    My Mood
    Cool
    Thanks
    32
    Thanked 54 Times in 47 Posts
    Blog Entries
    2

    Default Re: what is -xlint message?

    Wrap your code in highlight tags.
    [highlight=Java] *Code goes here* [/highlight]

Similar Threads

  1. HELP! Recompile with -Xlint:unchecked for details?????
    By polozelda in forum What's Wrong With My Code?
    Replies: 4
    Last Post: August 7th, 2011, 06:04 AM
  2. Hello Message
    By shaik42 in forum Member Introductions
    Replies: 1
    Last Post: July 3rd, 2011, 10:02 AM
  3. Send XML message over UDP?
    By udpkillsme in forum Java Networking
    Replies: 1
    Last Post: June 22nd, 2011, 11:27 AM
  4. Hello message
    By ceejaysoft in forum Member Introductions
    Replies: 1
    Last Post: March 17th, 2011, 04:18 AM
  5. help with a error message
    By JavaNoob82 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: January 23rd, 2010, 02:56 PM