Collection sort

Hi every body I have a small problem in sorting .
I am taking one collection of type string .When I am sorting I is giving me wrong result.
Here is my code :
List <String> caps = new ArrayList<String>();
caps.add("Alpha");
caps.add("Beta");
caps.add("alpha1");
caps.add("Delta");
caps.add("theta");
Collections.sort(caps);It is sorting like :
Alpha
Beta
Delta
alpha1
theta.
Here I can take ant type of string even upper case / lower case .
But the lower case words are coming later .
Please help me out.
thanks ,
S

default string sorting is case sensitive. if you want case insensitive sorting, do Collections.sort(caps, String.CASE_INSENSITIVE_ORDER)

Similar Messages

  • Error in proposed Collections.sort signature

    (A very long time ago I've send a note on this to the jsr comment list, but unfortunately I never got a reply nor did I notice a bug report. Therefore I propose the change again here).
    The signature of the Collections.sort method is very limiting:
      static <T> void sort(List<T> list, Comparator<T> c);This signature requires you to pass a Comparator that is parameterized with exactly the same type as the items in the List. However, often Comparators can be implemented more generic. The signature doesn't allow this. The only requirement for the sort algorithm is however to pass a Comparator that is able to compare the items in the List.
    This requirement is expressed by the following signature:
      static <T, E extends T> void sort(List<E> list, Comparator<T> comparator) The items in the List are now allowed to be more specific. Because I don't want to cast in Generic Java code I've implemented a tiny workaround:
      public static <T, E extends T> void sort(List<E> list, Comparator<T> comparator) {
        Collections.sort(list, new ComparatorWrapper<T, E>(comparator));
      private static class ComparatorWrapper<T, E extends T> implements Comparator<E> {
        private Comparator<T> _comparator;
        public ComparatorWrapper(Comparator<T> comparator) {
          super();
          _comparator = comparator;
        public int compare(E o1, E o2) {
          return _comparator.compare(o1, o2);
      }This proves the correctness of the new signature. This also proves that you have to be very careful in chosing a signature. I've been working with Generic Java for some years now, but I'm still making the same mistake now and then ...

    This will be fixed in a novel and interesting way in the new spec for GJ -- stay tuned! (I think mid-May/late-May is the expected timeframe for this.)

  • N^2 log(n) for Collections.sort() on a linked list in place?

    So, I was looking over the Java API regarding Collections.sort() on linked lists, and it says it dumps linked lists into an array so that it can call merge sort. Because, otherwise, sorting a linked list in place would lead to a complexity of O(n^2 log n) ... can someone explain how this happens?

    corlettk wrote:
    uj,
    ... there are other sorting methods for linked lists with an O(N*N) complexity.Please, what are those algorithms? I'm guesing they're variants off insertion sort, coz an insertion is O(1) in a linked list [and expensive in array]... Am I warm?You don't have to change the structure of a linked list to sort it. You can use an ordinary Bubblesort. (The list is repeatedly scanned. In each scan adjacent elements are compared and if they're in wrong order they're swapped. When one scan of the list passes without any swaps the list is sorted). This is an O(N*N) algoritm.
    What I mean is it's possible to sort a list with O(N*N) complexity. It doesn't have to be O(N*N*logN) as the Java documentation kind of suggests. In fact I wouldn't be surprised if there were special O(N*logN) algoritms available also for lists but I don't know really. In any case Java uses none of them.

  • Collections.sort() - sort on multiple fields?

    I have a collection of objects in a List that I need to be able to sort on each field individually. For example, the data in the List is eventually displayed on a table in a web page. The user is able to click on a column header and the table is to be refreshed with the list contents sorted by that column (asc/desc).
    I would rather not re-query the DB for this list (it's pretty static and already saved in memory). So if I use the Collections.sort(myList, new Comparator() { ...} ) method, is it possible for me to pass the field/direction of the sort into the Comparator? Or, do I have to define individual Comparators for every field that the user can sort by and surround it all by an ugly switch statement?

    Honestly I think that a re-query to the DB is the best approach. Remember that any decent DB engine will cache queries so it will really only have to re-perform the sort algorithm.
    Commercial databases are very fast and almost never the source of a performance bottleneck.
    I realize this isn't the answer you want, but in my experience it is the best solution, if you really can't stand to re-query then as mentioned creating your own comparator is the way to go.

  • Compile error when using Collections.sort for Vector, why?

    The compiler is giving an error when trying to do this (I'm using JDK 1.5.0_09):
    Vector <String> test = new Vector <String>();
    test.add("test1");
    test.add("test2");
    test.add("test3");
    Collections.sort(test);The error being:
    The method sort(Vector<String>) is undefined for the type Collections
    Collections.sort takes List, but Vector is of type List, so this should work, correct?

    ChuckBing wrote:
    No. Vector is not a subclass of List. Use List.um.. Vector implements List

  • TreeSet vs Collection.Sort / Array.sort for Strings

    Gurus
    I am pondering weather to use TreeSet vs the Collections.sort / Array.sort for sorting Strings.
    Basically I have a list of Strings, i need to perform the following operations on these Strings
    1) Able to list Strings starting with a Prefix
    2) Able to list Strings Lexically greater than a String
    Any help would be greatly appreciated!
    Thanks a bunch

    SpaceShuttle wrote:
    Gurus
    I am pondering weather to use TreeSet vs the Collections.sort / Array.sort for sorting Strings.
    Basically I have a list of Strings, i need to perform the following operations on these Strings
    1) Able to list Strings starting with a Prefix
    2) Able to list Strings Lexically greater than a String
    Any help would be greatly appreciated!
    Thanks a bunchBig-O wise, there's no difference between sorting a list of N elements or inserting them one by one in a tree-set. Both take O(n*log(n)). But both collections are not well suited for looking up string that start with a certain substring. In that case you had better use a Patricia tree (or Radix tree).
    Good luck.

  • Compiler warning with Collections.sort() method

    Hi,
    I am sorting a Vector that contains CardTiles objects. CardTiles is a class that extends JButton and implements Comparable. The code works fine but i get the following warning after compilation.
    Note: DeckOfCards.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    After compiling with -Xlint, i get the following warning;
    DeckOfCards.java:173: warning: [unchecked] unchecked method invocation: <T>sort(java.util.List<T>) in java.util.Collections is applied to (java.util.Vector<CardTiles>)
    Collections.sort(handTwo);
    ^
    What could be the problem? Is Collections.sort() only intended for Collections of type List?
    Many thanks!

    Hi Jverd, my handTwo Vector was declared as follows;
    Vector<CardTiles> handTwo = new Vector<CardTiles>();
    The CardTiles Source code is as follows;
    import javax.swing.*;
    import java.util.*;
    public class CardTiles extends JButton implements Comparable{
         static String typeOfSort = "face";
         public static final long serialVersionUID = 24362462L;
         int i=1;
         public ImageIcon myIcon;
         public Card myCard;
         public CardTiles(ImageIcon i, Card c){
              super(i);
              myIcon = i;
              myCard = c;
         public int compareTo(Object o){
              CardTiles compare = (CardTiles)o;
              if(typeOfSort.equals("face")){
                   Integer ref1 = new Integer(this.myCard.getFaceValue());
                   Integer ref2 = new Integer(compare.myCard.getFaceValue());
                   return ref1.compareTo(ref2);
              }else{
                   if(this.myCard.getFaceValue() > 9 || compare.myCard.getFaceValue() >9){
                        if(this.myCard.getFaceValue() > 9 && compare.myCard.getFaceValue() >9){
                             String ref1 = this.myCard.getSuit().substring(0,(this.myCard.getSuit().length()-1));
                             String ref2 = compare.myCard.getSuit().substring(0,(compare.myCard.getSuit().length()-1));
                             return ref1.compareTo(ref2);
                        }else{
                             if(this.myCard.getFaceValue() > 9 || compare.myCard.getFaceValue() >9){
                                  String ref1 = this.myCard.getSuit().substring(0,(this.myCard.getSuit().length()-1));
                                  String ref2 = compare.myCard.getSuit() + Integer.toString(compare.myCard.getFaceValue());
                                  return ref1.compareTo(ref2);
                             }else{
                                  String ref1 = this.myCard.getSuit() + Integer.toString(this.myCard.getFaceValue());
                                  String ref2 = compare.myCard.getSuit().substring(0,(compare.myCard.getSuit().length()-1));
                                  return ref1.compareTo(ref2);
                   }else{
                        String ref1 = this.myCard.getSuit() + Integer.toString(this.myCard.getFaceValue());
                        String ref2 = compare.myCard.getSuit() + Integer.toString(compare.myCard.getFaceValue());
                        return ref1.compareTo(ref2);
         public String toString(){
              return ( myCard.toString() + " with fileName " + myIcon.toString());
    }What could be wrong?
    Many thanks!

  • Can someone explain simply what "collections.sort " does???

    Hi,
    i'm learning java with "teach yourself java 6 in 21 days" and i'm on day6 trying to implement interfaces and packages. what i can't understand is...
    there are two classes Storefront and Item in a package. there's another class GiftShop which imports this package. Item implements comparable(the interface) and defines the method comapreTo. Now GiftShop calls a method sort which is in Storefront which inturn calls Collection.sort passing it the linked list called catalog. as far as i understand, this collection.sort calls the compareTo method and sorts the linkedlist somehow. please explain to me how and please tell me where does this collection.sort comes in from? where does it reside basically????
    i'm confuseddddd and i really need to move on so please help help help
    package org.cadenhead.ecommerce;
    import java.util.*;
    public class Item implements Comparable {
         private String id;
         private String name;
         private double retail;
         private int quantity;
         private double price;
         Item(String idIn, String nameIn, String retailIn, String quanIn){
              id = idIn;
              name = nameIn;
              retail = Double.parseDouble(retailIn);
              quantity = Integer.parseInt(quanIn);
              if (quantity > 400)
                   price = retail * .5D;
              else if (quantity > 200)
                   price = retail * .6D;
              else
                   price = retail * .7D;
              price = Math.floor(price * 100 + .5) / 100;
         public int compareTo(Object obj) {
              Item temp = (Item)obj;
              if (this.price < temp.price)
                   return 1;
              else if (this.price > temp.price)
                   return -1;
              return 0;
         public String getId() {
              return id;
         public String getName() {
              return name;
         public double getRetail() {
              return retail;
         public double getPrice() {
              return price;
         public int getQuantity() {
              return quantity;
    package org.cadenhead.ecommerce;
    import java.util.*;
    public class Storefront {
         private LinkedList catalog = new LinkedList();
         public void addItem(String id, String name, String price, String quant) {
              Item it = new Item(id, name, price, quant);
              catalog.add(it);
         public Item getItem(int i) {
              return (Item)catalog.get(i);
         public int getSize() {
              return catalog.size();
         public void sort() {
              Collections.sort(catalog);
    import org.cadenhead.ecommerce.*;
    //import org.cadenhead.ecommerce.Item;
    public class GiftShop {
         public static void main(String[] arguments){
              //Item ti = new Item("C01", "MUG", "9.99", "150");
              Storefront store = new Storefront();
              store.addItem("C01", "MUG", "9.99", "150");
              store.addItem("C02", "LG MUG", "12.99", "82");
              store.addItem("C03", "MOUSEPAD", "10.49", "800");
              store.addItem("D01", "T SHIRT", "16.99", "90");
              for (int i = 0; i < store.getSize(); i++) {
                   Item show = (Item)store.getItem(i);
                   System.out.println("\n Item ID: " + show.getId() +
                        "\n Name: " + show.getName());
              store.sort();
              System.out.println("Catalog Size: " + store.getSize());
              for (int i = 0; i < store.getSize(); i++) {
                   Item show = (Item)store.getItem(i);
                   System.out.println("\n Item ID: " + show.getId() +
                        "\n Name: " + show.getName() +
                        "\n Retail Price: " + show.getRetail() +
                        "\n Price: " + show.getPrice() +
                        "\n Quantity: " + show.getQuantity());
    }

    Chiya wrote:
    what are code tags?When you post code, please post it between [code] and [/code] tags (you can also use the appropriate button on the message posting screen). It makes your code much easier to read and prevents accidental markup from the forum software.
    Example:import org.cadenhead.ecommerce.*;
    public class GiftShop {
         public static void main(String[] arguments){
              Storefront store = new Storefront();
              store.addItem("C01", "MUG", "9.99", "150");
              store.addItem("C02", "LG MUG", "12.99", "82");
              store.addItem("C03", "MOUSEPAD", "10.49", "800");
              store.addItem("D01", "T SHIRT", "16.99", "90");
              for (int i = 0; i < store.getSize(); i++) {
                   Item show = (Item)store.getItem(i);
                   System.out.println("\n Item ID: " + show.getId() +
                   "\n Name: " + show.getName());
              store.sort();
              System.out.println("Catalog Size: " + store.getSize());
              for (int i = 0; i < store.getSize(); i++) {
                   Item show = (Item)store.getItem(i);
                   System.out.println("\n Item ID: " + show.getId() +
                   "\n Name: " + show.getName() +
                   "\n Retail Price: " + show.getRetail() +
                   "\n Price: " + show.getPrice() +
                   "\n Quantity: " + show.getQuantity());
    } ~

  • Collections.sort question

    Hi,
    This is my question. I have the following classes
    class A {
         int num = 1;
    class B extends A implements Comparable<B>{
       int count = 0;
       public int compareTo(B b) {
            return count - b.getCount;  
      public void setCount(int count) {
            this.count = count;
      public int getCount() {
             return count;
    }After i put the a couple of the B classes (after setting count) in a LinkedList of type A, i get a problem trying to sort them. The compiler gives me a variable Collections error on the Collections.sort
    Any ideas on how to solve this would be appreciated.
    Thanks

    Are you talking about this A* algorithm? (I've never heard of it before.)
    http://en.wikipedia.org/wiki/A-star_search_algorithm
    The code you have with the "instanceof" test might work. Not sure what the goal is, or how the algorithm works (I didn't read the above link in detail), so I can't say for sure whether it will "work" for what you are doing. Once you sort the "B" objects, what do you need to do with that sublist (i.e., with the bList in your code)?
    I've never used generics, so I don't know much about them. Is it possible to make "A" Comparable, giving a dummy implementation to compareTo (i.e., maybe even just make it always return '0' [all values are equal]), and then have "B" implement Comparable such that B's compareTo will override A's version? I don't know if it is possible (or even desirable)--just a thought.

  • How can i use Collections.sort

    hi! i hope someone can help me. Im trying to sort a list that has Strings on it...
    list.add("rmjBBrmj");
    list.add("rmjAArmj");
    list.add("rmjDDrmj");
    list.add("rmjCCrmj");
    How can i use the "Collections.sort" if i wanted it sorted by the capital letters, like rmjAArmj,rmjBBrmj,rmjCCrmj,rmjDDrmj. Thank you very much for your help.

    You override the "natural" sort order by suppling a Comparitor which orders any pair of strings as you see fit, e.g. convert them to upper case before comparing.

  • Add_item : Attributes list collection sort order

    Hello:
    I created multiple custom attributes and added them to my custom item type. I need to apply these attributes while adding an item programmatically.
    1) How do i define the order of the Attributes list via the Portal builder so as to match the corresponding values read from a list/table,etc. ?
    2) The ordering arrow buttons in the attribute list of my custom item type does not match the result set from my query. I tried all options of "order by" clause. Here is the query - (componenttype is the name of my custom item type)
    select iatts.ID
    ,atts.caid
         ,atts.DATA_TYPE     
         ,atts.CAID
         ,atts.NAME,atts.DISPLAY_NAME
         ,iatts.ITEM_TYPE_ID
    from wwsbr_item_types itypes
    ,wwsbr_item_type_attributes iatts
    ,wwsbr_attributes atts
    where --itypes.caid = 133
    itypes.name like 'ComponentType'
    and itypes.ID = iatts.ITEM_TYPE_ID
    and iatts.ATTRIBUTE_ID = atts.ID
    --and atts.CAID = 133
    order by atts.id
    3) I need to expect a certain order of the attribute ids, when bulk collecting into the attributes array, in order to populate the values collection in the same. So, how do I determine the order of the attributes ids ?
    4) Is there a better way to do this ?
    Thank You.
    regards
    Ananth

    Document Sets are great tools for grouping multiple documents together. However, if every set has exactly one document, it would be better to just upload the file and not place it within a Document Set:
    Uploading documents using object model - http://msdn.microsoft.com/en-us/library/office/ms454491(v=office.14).aspx
    Uploading documents using web services -
    http://cecildt.blogspot.com/2010/10/upload-documents-to-sharepoint-2010.html
    If you have requirements to use Document Sets, keep in mind that this adds a layer of complexity beyond a simple Document Library. Behind the scenes, each Document Set is treated as a separate folder, and although can you query items within it, there might
    be extra steps for getting the sort order to ignore the folder structure. Can you try setting the Scope to be "Recursive" and also specify that you are looking only for files and not folders:
    <Eq><FieldRef Name='FSObjType'/><Value Type='Lookup'>1</Value></Eq></Where>
    Dimitri Ayrapetov (MCSE: SharePoint)

  • Collections.sort()

    HI all
    I am re-writing a program which I wrote earlier which takes a list
    1 Joanne Smith and Lionel Brown
    2 Augustus Belcher
    3 Fatima Bacon and Gaynor White
    4 Celina Simmons and Rupert Rodgers-Smythe
    5 Ahmed Hussain
    6 Samuel Peacock and Sarah Peacock
    7 Hsin Cheng Liu
    8 Blanche Peacock and Harry Peacock
    and outputs
    1 Joanne Smith and Lionel Brown
    3 Fatima Bacon and Gaynor White
    5 Ahmed Hussain
    7 Hsin Cheng Liu
    8 Blanche Peacock and Harry Peacock
    6 Samuel Peacock and Sarah Peacock
    4 Celina Simmons and Rupert Rodgers-Smythe
    2 Augustus Belcher
    My brief is
    Create a class called DeliveryHouseDetails, which is Comparable with itself. This will
    store a house number in an instance variable, and the person name details in another. It
    will have an accessor method to obtain the person names. It will also have another in-
    stance method, compareTo(), which orders DeliveryHouseDetails objects by delivery
    order.
    Copy your StreetOrder class from the previous version, and modify it so that it creates a
    DeliveryHouseDetails object for each input line and stores it in the ArrayList. You can
    simply count the lines to obtain the house number ? there is no need to extract it from the details
    on the line. After loading the details the program will use sort() from the Collections class
    to sort them, then it can print them out by looping through them all, and extracting the person
    details.
    My code thus far
    public class DeliveryHouseDetails<ArrayType extends Comparable<ArrayType>>
       private int houseNumber;
       private String nameDetails;
       public DeliveryHouseDetails(String requiredNameDetails)
        nameDetails = requiredNameDetails;
      }//constructor
      public String getNamesDetails()
        return nameDetails;
      public int compareTo(int other)
        if((houseNumber % 2 == 1)&&(other % 2 ==1))
          return houseNumber - other;
        else if((houseNumber % 2 == 0)&& (other % 2 == 0))
          return (other - houseNumber);
        else if(houseNumber % 2 ==1)
          return -1;
        else
          return -1;
      public boolean equals(Object other)
        if (this.equals(other))
          return houseNumber == ((DeliveryHouseDetails)other).houseNumber;
        else
          return super.equals(other);
    import java.io.BufferedReader;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.PrintWriter;
    import java.util.ArrayList;
    import java.util.Collections;
    import java.io.IOException;
    import java.io.FileNotFoundException;
    public class StreetOrderA
      public static void main(String [] args)
        String inputFileName = args[0];
        String outputFileName = args[1];
        ArrayList<String> lineList = new ArrayList<String>();
        String line;
        String item;
        try
        BufferedReader in=new BufferedReader(new FileReader(inputFileName));
        PrintWriter out=new PrintWriter(new FileWriter(outputFileName)); 
        if(args.length!=2)
          throw new ArrayIndexOutOfBoundsException("you have supplied"
                                +" the wrong no of arguments");
        while((line = in.readLine()) != null)
            item = new DeliveryHouseDetails(line);
          for(int index =0; index<=lineList.size();index++)
            lineList.add(item);
          Collections.<String>sort(lineList);
          for(int index =0; index<=lineList.size();index++)
            out.println(lineList.get(index));
          in.close();
          out.close();
       catch (FileNotFoundException e)
          System.out.println("Can't find the file, please enter a valid file");
         System.out.println("Exception"+e.getMessage());
           System.err.println(e); 
        catch (IOException e)
          System.err.println(e);
        catch (ArrayIndexOutOfBoundsException e)
          System.out.println("Supply two filenames");
          System.out.println("Exception message"+ e.getMessage());
          System.err.println(e);
    }Any help is appreciated !!
    Edited by: bigdoggy on Apr 6, 2008 12:34 PM

    Hi
    this is my StreetOrder code, updated from earlier but without the import statements and catch statements from before
    public static void main(String [] args)
        String inputFileName = args[0];
        String outputFileName = args[1];
        ArrayList<DeliveryHouseDetails> lineList
          = new ArrayList<DeliveryHouseDetails>();
        String line;
        try
        BufferedReader in=new BufferedReader(new FileReader(inputFileName));
        PrintWriter out=new PrintWriter(new FileWriter(outputFileName));  
        if(args.length!=2)
          throw new ArrayIndexOutOfBoundsException("you have supplied"
                                  +" the wrong no of arguments");
        while((line = in.readLine()) != null)
            DeliveryHouseDetails item = new DeliveryHouseDetails(line);
          for(int index =0; index<=lineList.size();index++)
            lineList.add(item);
          Collections.<String>sort(lineList);
          for(int index =0; index<=lineList.size();index++)
            out.println(lineList.get(index));
          in.close();
          out.close();

  • Can't Manually Change Collection Sort Order

    When trying to manually change the sort order of any collection I get the following error message:
    Database "/Users/Dan Donovan/Pictures/Lightroom/Lightroom 5 Catalog.lrcat": AgLibraryCollectionImageOzSortOrder.positionInCollection may not be NULL
      Statement:  INSERT OR REPLACE INTO AgLibraryCollectionImageOzSortOrder
      ( collectionImage, collection, positionInCollection, ozSortOrder )
      VALUES( ?, ?, ?, ? )
    Any suggestions?
    Thanks!
    Dan

    Some others have reported this on the official feedback forum:
    LIGHTROOM 5.5: Error when moving grouped images in Grid view.
    Lightroom CC Re-Sorting within a collection giving error message
    LightRoom 5.5 OSX 10.9.3: Custom sort within a collection gives an error (screenshot attached)
    Please add your opinion and votes to those threads.  The threads include some workarounds you might try.

  • Sort JCheckBox table column using Collections.sort()

    Hello,
    I'm trying to add a JCheckBox column to a JTable component but am having a problem with sorting. The problem is that I don't know how to do it. I've tried several different ways without any luck. I would like to use the "java.util.Collections" class for the sorting of the DataVector within the DefaultTableModel (though I did get it to work with shaky implementation of sort that I found on the web).
    Any help would be wonderful.
    - Dan

    Chapter 18, Section 18.5 http://www.spindoczine.com/sbe/

  • ItunesU collection: Sorting Options

    Under ItunesU, I have in the past been able to "sort by name" (clicking "view" at the top, then "show view options", then sort by "name") for my ItunesU collections.  Currently, however, I am only able to sort by "release date".  How do I fix this?

    For anyone else looking for a solution to this, it can be solved by selecting all the videos, Get Info and changing Part of a Compilation to Yes (Options tab). It may also be necessary to 'update' the Track Number and Disc Number to be empty if there's already a numbering scheme. This means checking the box under each and clearing out any other info.
    For one course, the compilation trick worked, while the second required both to put the individual classes in order.

Maybe you are looking for

  • How to run different programs and use their output in other programs

    Dear java members, I am trying to figure out how to get data from a file, database, or program and use that information in another program. Can you help please? I have looked through several texts and while the information is there somewhere I have n

  • Mac OS Error Result Code 1634955892

    The subject error message is what I got when I tried to copy a DVD that would not play all the way using Toast, to se if I could recover. It says after exttracting the DVD and putting in the media that it cannot record because of a Mac OS error resul

  • Filter in RSPLSE not working.

    Hi, I have made the Lock setting for one of the IP query in RSPLSE EXPERT mode. It is working fine in Dev environment. But I have transported settings to Test and it is not working there. Please elt me know what I could be missing out. Thanks in adva

  • IMac G5 (1.8 Ghz) Shuts down after being put to sleep

    My G5 shuts down immediately after being put to sleep and shortly after falling into sleep mode automatically. I have reset the SMU to no avail. I have also reset the Energy Saver preferences to the default setting.I didn't have this problem prior to

  • I am trying to authorize a new computer.  I can not fine the authorize option once I open Itunes

    I am trying to authorize a new computer.  i have opened iTunes.  I only see a link for the apps store.  Where do I find the Stgore/Authorize button?