Alphabetizing vectors

Does java have a class that alphabetizes strings? Say I had a list of 20 words, can I run those through a built in method? If not, can someone loan a "black box" alphabetizing algorithm?
A algorithm that did numbers would get extra dukes!
Thanks!

Your subject mentions Vectors, but your question doesn't, so I'll stick to your question first. Java has an Arrays utility class the contains many conveinence methods for sorting arrays. The following code will sort an array of String objects:
String[] array = {"Mike", "Bob", "Tina", "Tim"};
Arrays.sort(array);Take a look at the java.util.Arrays class and you'll also find that it contains sorting methods for all the primitives as well as the blanket Object arrays.
As far as dealing with Vectors, there are methods within the Vector class to return an array (Vector.toArray() and Vector.toArray(Object[])). So one way to sort a Vector is to turn it into an Array and then sort it with the methods above.
Hope that helps,
Mike

Similar Messages

  • Sorting a Vector by position in Alphabet

    Hey Folks,
    I have a Vector containing pairs of letters. e.g.
    ad
    ac
    de
    be
    bd
    Is it possible to sort the Vector by position in the Alphabet i.e. pairs beginning with 'a' are first, then those starting with 'b' etc... So would end up with something like:
    ac
    ad
    bd
    be
    de
    I'm not too bothered about the position of the second letter but would be a bonus if it was taken into consideration!
    Any help or suggestions would be great thanks.

    Please note that the code given sorts by Unicode value of the characters in the Strings (e.g. capital Z appears before lowercase a), NOT alphabetically. This may or may not be what you want.
    If you want to sort alphabetically (and/or for a specific locale), use a Collator as the second argument for the sort:Collections.sort(vector, Collator.getInstance(); // default locale of your machineorCollections.sort(vector, Collator.getInstance(Locale.US); // specific locale: US English

  • How to sort a Vector that stores a particular object type, by an attribute?

    Hi guys,
    i need help on this problem that i'm having. i have a vector that stores a particular object type, and i would like to sort the elements in that vector alphabetically, by comparing the attribute contained in that element. here's the code:
    Class that creates the object
    public class Patient {
    private String patientName, nameOfParent, phoneNumber;
    private GregorianCalendar dateOfBirth;
    private char sex;
    private MedicalHistory medHistory;
    public Patient (String patientName, String nameOfParent, String phoneNumber, GregorianCalendar dateOfBirth, char sex) {
    this.patientName = patientName;
    this.nameOfParent = nameOfParent;
    this.phoneNumber = phoneNumber;
    this.dateOfBirth = dateOfBirth;
    this.sex = sex;
    this.medHistory = new MedicalHistory();
    Class that creates the Vector.
    public class PatientDatabase {
    private Vector <Patient> patientDB = new Vector <Patient> ();
    private DateFunction date = new DateFunction();
    public PatientDatabase () throws IOException{
    String textLine;
    BufferedReader console = new BufferedReader(new FileReader("patient.txt"));
    while ((textLine = console.readLine()) != null) {
    StringTokenizer inReader = new StringTokenizer(textLine,"\t");
    if(inReader.countTokens() != 7)
    throw new IOException("Invalid Input Format");
    else {
    String patientName = inReader.nextToken();
    String nameOfParent = inReader.nextToken();
    String phoneNum = inReader.nextToken();
    int birthYear = Integer.parseInt(inReader.nextToken());
    int birthMonth = Integer.parseInt(inReader.nextToken());
    int birthDay = Integer.parseInt(inReader.nextToken());
    char sex = inReader.nextToken().charAt(0);
    GregorianCalendar dateOfBirth = new GregorianCalendar(birthYear, birthMonth, birthDay);
    Patient newPatient = new Patient(patientName, nameOfParent, phoneNum, dateOfBirth, sex);
    patientDB.addElement(newPatient);
    console.close();
    *note that the constructor actually reads a file and tokenizes each element to an attribute, and each attribute is passed through the constructor of the Patient class to instantiate the object.  it then stores the object into the vector as an element.
    based on this, i would like to sort the vector according to the object's patientName attribute, alphabetically. can anyone out there help me on this?
    i have read most of the threads posted on this forum regarding similar issues, but i don't really understand on how the concept works and how would the Comparable be used to compare the patientName attributes.
    Thanks for your help, guys!

    Are you sure that you will always sort for the patient's name throughout the application? If not, you should consider using Comparators rather than implement Comparable. For the latter, one usually should ensure that the compare() method is consistent with equals(). As for health applications it is likely that there are patients having the same name, reducing compare to the patient's name is hazardous.
    Both, Comparator and Comparable are explained in Sun's Tutorial.

  • HOW TO DELETE DUPLICATE ELEMENT IN A VECTOR

    Hi everybody!
    If I've a vector like this vectA={apple,orange,grape,apple,apple,banana}
    and I want final result be vectB={apple,orange,grape,banana}.
    How should I compare each element in vectA and delete duplicate element. Like here duplicated element is apple. Only one apple remain in the vectB.
    Any help,
    Thanks.

    Hello all. Good question and good answers, but I would like to elaborate.
    To begin with, you specifically asked to map the following:
    {apple,orange,grape,apple,apple,banana} ==> {apple,orange,grape,banana}
    Both of cotton.m's solutions do NOT do this, unfortunately. They are both useful in particular cases though, so think about what you're trying to do:
    cotton.m's first solution is best if order does not matter. In fact, as flounder first stated, whenever order doesn't matter, your most efficient bet is to use a Set instead of a List (or Vector) anyways.
    Set vectB = new HashSet(vectA);This code maps to {banana, orange, grape, apple}, because HashSets are "randomly" ordered.
    cotton.m's second solution is good if you want to impose NEW ordering on the List.
    Set vectB = new TreeSet(vectA);This code maps to {apple, banana, grape, orange}, because TreeSet uses alphabetical-order on Strings by default.
    java_2006, your solution is the most correct, but it's a little verbose for my taste :)
    more importantly, the runtime-efficiency is pretty bad (n-squared). calling Vector.contains performs (at worst) n comparisons; you're going to call it n times! Set.contains usually performs 2 comparisons (constant, much better), so I suggest you USE a Set to do the filtering, while still sticking with your good idea to use a List. When the ordering is "arbitrary" (so can't use TreeSet) but still relevant (so can't use HashSet), you're basically talking about a List.
    I think saving A LOT of time is worth using A LITTLE extra space, so here, let's save ourself some runtime, and some carpal-tunnel.
    import java.util.*;
    class Foo {
         public static void main(String[] args) {
              String[] fruits = {"apple","orange","grape","apple","apple","banana"};
              List     l = Arrays.asList(fruits),
                   m = filterDups(l);
              System.out.println(m);
         // remember, both of the following methods use O(n) space, but only O(n) time
         static List filterDups(List l) {
              List retVal = new ArrayList();
              Set s = new HashSet();
              for (Object o : l)
                   if (s.add(o))
                        retVal.add(o);     // Set.add returns true iff the item was NOT already present
              return retVal;
         static void killDups(List l) {
              Set s = new HashSet();
              for (Iterator i = l.iterator(); i.hasNext(); )
                   if (! s.add(i.next()))     
                        i.remove();
         // honestly, please don't use Vectors ever again... thanks!
         // if you're going to be a jerk about it, and claim you NEED a Vector result
         // then here's your code, whiner
         public static void mainx(String[] args) {
              String[] fruits = {"apple","orange","grape","apple","apple","banana"};
              List l = Arrays.asList(fruits);
              Vector v = new Vector(l);
              killDups(v);
              System.out.println(v);
    }

  • Imported Vectors showing up as "Vector Art Sequence" Not "Vector Art"

    I am using After Effects CS6
    I recently imported a few Illustrator files into a composition in After effects for a project. I Imported them as a composition so I can use the different layers in the document. The files for one of the documents are Vector Art, but the other ones have come in as Vector Art Sequences. I'm not sure the difference between the two. I read on the forums that it has something to do with the "forcing alphabetical order" option box. I have made sure that this is not checked and have tried all the options for importing a compostion, still no luck.
    Is it something that needs to be done to the Illustrator file itself? Or am I doing some incorrectly. Also, I would like to understand the difference between Vector Art files and Vector Art Sequences. All I know is that both can be continuously rasterized, so it doesn't seem to be jeopardizing my project.
    Thanks for your time.

    You had enabled the "Sequence"check box at one point. Simply use File --> Repalce Footage and load the files again with correct options.
    Mylenium

  • Sorting Arrays in a Vector by a String field in the array

    Hi
    i have a Vector where i put Arrays in. These Arrays are all of the same type. The first field is kind of an indetifier, the type is String. That's the key field i'd like to sort the vector elements in an alphabetical order.
    I know there is that Collator methode to sort Vectors. That's no problem for me to do if i just have Strings in the Vector. But with this contruct of Arrays that need do be sortet for one fiel of the array, i have no idea whether this might be done with that Collator methode too.
    So, before i start written some kind of bubble sort methode (that sure would solve the problem, but probably not very smart and fast...) I'd like to ask you, whether you have an idea how to solve that problem with Collator or even with some other methode?
    thanks for your help!

    Comparable and Arrays.sort. Read the APIs, or look at the two or three examples I've done so far today in this forum. Or search the forum for +Comparable Arrays sort
    Answer provided by Friends of the Water Cooler. Please inform forum admin via the
    'Discuss the JDC Web Site' forum that off-topic threads should be supported.

  • [svn:fx-trunk] 7916: Last of the List PARB changes - selectedItems is now a Vector of Objects and selectedIndices is a Vector of Numbers .

    Revision: 7916
    Author:   [email protected]
    Date:     2009-06-17 09:04:51 -0700 (Wed, 17 Jun 2009)
    Log Message:
    Last of the List PARB changes - selectedItems is now a Vector of Objects and selectedIndices is a Vector of Numbers.
    Also, put alphabetized spark-manifest correctly after my last checkin.
    QA: Yes
    Doc: Yes
    Checkintests: Pass
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/List.as
        flex/sdk/trunk/frameworks/spark-manifest.xml

    Gordon, it looks like its been a while since you made this post.  Not sure how valid it is now...   I am particularly interested in the LigatureLevel.NONE value.  It seems that it is no longer supported.
    How do I turn of ligatures in the font rendering?
    My flex project involves trying to match the font rendering of Apache's Batik rendering of SVG and ligatures have been turned off in that codebase.  Is there any way (even roundabout) to turn ligatures off in flash?
    Thanks,
    Om

  • Vector sorting help

    hi, im trying to figure out how to sort the vector objects below in alphabetical order. But i can't figure out how to fix this code
    any help is greatly appreciated. THANKS!!!
    import java.lang.String.*;
    import java.util.Vector;
    public class Test2
    public void hi()
    Vector v = new Vector();
    v.add("Donkey");
    v.add("Dog");
    v.add("Parakeet");
    v.add("Cat");
    v.add("Mule");
    v.add("Horse");
    v.add("Zebra");
    v.add("Lion");
    v.add("Frog");
    v.add("Catepillar");
    v.add("Butterfly");
    v.add("Ostrich");
    for(int i = 0; i < v.size(); i++)
    int o = i;
    int j = i - 1;
    while(j>=0 && j > o)
    v.get(j + 1) = v.get(i);
    j--;
    j + 1 = o;
    //substring(s.indexOf(",") + 2, s.indexOf("[") - 1)
    }

    hi, im trying to figure out how to sort the vector
    objects below in alphabetical order. But i can't
    figure out how to fix this code
    any help is greatly appreciated. THANKS!!!
    import java.lang.String.*;
    import java.util.Vector;
    public class Test2
    public void hi()
    Vector v = new Vector();
    v.add("Donkey");
    v.add("Dog");
    v.add("Parakeet");
    v.add("Cat");
    v.add("Mule");
    v.add("Horse");
    v.add("Zebra");
    v.add("Lion");
    v.add("Frog");
    v.add("Catepillar");
    v.add("Butterfly");
    v.add("Ostrich");
    for(int i = 0; i < v.size(); i++)
    int o = i;
    int j = i - 1;
    while(j>=0 && j > o)
    v.get(j + 1) = v.get(i);
    j--;
    j + 1 = o;
    //substring(s.indexOf(",") + 2, s.indexOf("[") -
    ) - 1)
    }Hi!
    You can't do:
    v.get(j + 1) = v.get(i);
    I think what you want to do is:
    v.set(j+1,v.get(i));
    Read this:
    "set
    public Object set(int�index,Object�element)
    Replaces the element at the specified position in this Vector with the specified element."
    If you have other questions, just say!
    Hope it helps!!!
    Regards,
    ACN

  • Regular Expressions + using them in Vector analysis

    Hello,
    I would be very glad for any hint concerning this problem:
    Consider this ilustrational code sample
    import java.util.regex.*;
    Vector sequence = new Vector();
            sequence.add("-");
            sequence.add("-");
            sequence.add("A");
            sequence.add("-");
            sequence.add("B");I want to find the first occurence of any alphabetical character ...I thought I can do it like this:
    int index = sequence.indexOf("\\w");or from the other point of view like this:
    int index = sequence.indexOf("[^-]");Unfortunately none of these are working. Do you know why and how to fix this? There are supposed to be only alphabetical characters and "-" character...
    thanks a lot
    adam

    mAdam wrote:
    well, the code I posted above should suit only as an illustration of my problem.
    ActualIy I have a bunch of those sequences in an Arraylist...it can be from 5 - 100 sequences(vectors) and I need to use some methods which are available only for Collections (frequency(), insertElementAt()...etc.). I am not a proffesional programmer so I do hope that I am using it correctly instead of "simple" String[][] BunchOfSequences = {seq1,seq2,...}I am not aware of any frequency() or insertElementAt() methods in one of Java's collection classes.
    Is it possible to use regular expressions to find a first occurence of a "a-z"(or "A-Z"..it doesnt matter) in a vector then? Or I just need to find it in a "for loop"?
    thx
    adamRegexes only work on Strings, not on collections holding Strings. So yes, you will need to use a for statement (or similar).
    List<String> list = ...
    for(String s : list) {
      if(s.matches("\\w")) {
    }

  • How do I convert color image to color vector?

    Hi,
    Im fairly new/not very well versed in Illustrator, I was wondering if you guys could help me with instructions or tips how to convert old alphabet art to color and actualy converting color images like drawings to vector . Ive tried image trace but it turns the image black and white and with really rough strokes.
    Thank you!

    Is this art in the Public Domain? Or, do you have the copyright owner's permission to use it in your work? If the answer to both of these questions is no, then you should not be using it.
    That being said, I got good results with image trace (using the High Fidelity Photo preset) even on the low-res image you attached here. You just have to adjust the preferences after you do the trace.

  • From vector to font, how?

    I am just wondering if is it there some way how can I do that?
    Make from a vectors based document- There I made whole alphabet letters by pen tool. And my goal is that document render to FONT Files. Open type, true type etc.
    Is there some possible way how can I do that?
    Thank you very much
    PS: I have just tried exporting vector data from photoshop to ai (path) and try to open it in FontLab Studio and generate from that app font, but unsucessfull
    How can I do it?

    From PS to AI:
    Simply open the PS file in Illustrator. If you want to save in some
    other format, just Save As ...
    From Illustrator to FontLab
    IMPORT EPS sometimes works, but IMPORT in FontLab doesn't work with
    newer versions of EPS or AI files.  Instead,
    have both applications open. Highlight a design or character or glyph in
    Illy and COPY. Open the appropriate glyph window in FontLab and Paste.
    You may have to isolate them.
    It will take some experience to determine how large to magnify the
    design elements in Illustrator and where to place them before copying.
    You can also copy and paste many at once, into some arbitrary FontLab
    cell, and then move or copy or manipulate individual items in FontLab.
    Often the EPS/AI vectors come across to FontLab without being closed;
    you then have to go to contours and close open contours.
    If your pen tool designs are simply lines and not outlined elements,
    they're useless as fonts, by the way.
      - H

  • Alphabetical sort...

    Hi,
    I would like to sort an array of strings alphabetically.
    String[] fileList = logDirectory.list();
    I wanna sort fileList by name.
    I know i can do it by checking each string and comparing it to the others or sth like that. my question is, is there a java method that can sort an array/vector/... by name?
    thx! :o)

    ok sorry, i just realised that was a really dumb question! all i have to do is use java.util.Arrays.sort( fileList)!!! sorry again lol! :o)

  • Sort JTree alphabetical

    Hello everyone! I am trying to sort a JTree alphabetical. For the moment i made only the roots (partitions) to sort. I use the JTree to view all the partitions and view all the files. I override the interface TreeNode for my needs...and i made a class for cell renderer...
    public class FileTreeNode implements TreeNode
         public File file;
         private File[] children;     
         private  TreeNode parent;     
         public boolean isFileSystemRoot;     
         public FileTreeNode(File file, boolean isFileSystemRoot, TreeNode parent)
              this.file = file;
              this.isFileSystemRoot = isFileSystemRoot;
              this.parent = parent;
              this.children = this.file.listFiles();
              if (this.children == null)
                   this.children = new File[0];
         public FileTreeNode(File[] children)
              this.file = null;
              this.parent = null;
              this.children = children;               
         @Override
         public Enumeration<?> children()
              final int elementCount = this.children.length;
              return new Enumeration<File>()
                   int count = 0;
                   public boolean hasMoreElements()
                        return this.count < elementCount;
                   public File nextElement()
                        if (this.count < elementCount)
                             return FileTreeNode.this.children[this.count++];
                        throw new NoSuchElementException("Vector Enumeration");
         @Override
         public boolean getAllowsChildren()
              return true;
         @Override
         public TreeNode getChildAt(int childIndex)
              return new FileTreeNode(this.children[childIndex],this.parent == null, this);
         @Override
         public int getChildCount()
              return this.children.length;
         @Override
         public int getIndex(TreeNode node)
              FileTreeNode ftn = (FileTreeNode) node;
              for (int i = 0; i < this.children.length; i++)
                   if (ftn.file.equals(this.children))
                        return i;                    
              return -1;
         @Override
         public TreeNode getParent()
              return this.parent;
         @Override
         public boolean isLeaf()
              return (this.getChildCount() == 0);
         public void sortRoots()
              List<File> list = Arrays.asList(this.children);
              Collections.sort(list);
              System.out.println("Partitions: " + list);
    and the other class....public class FileTreeCellRenderer extends DefaultTreeCellRenderer
         private static final long serialVersionUID = 1L;
         protected static FileSystemView fsv = FileSystemView.getFileSystemView();
         private Map<String, Icon> iconCache = new HashMap<String, Icon>();          
         private Map<File, String> rootNameCache = new HashMap<File, String>();     
         public Component getTreeCellRendererComponent(JTree tree, Object value,
                   boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
              FileTreeNode ftn = (FileTreeNode) value;
              File file = ftn.file;
              String filename = "";
              if (file != null)
                   if (ftn.isFileSystemRoot)
                        filename = this.rootNameCache.get(file);
                        if (filename == null)
                             filename = fsv.getSystemDisplayName(file);                         
                             this.rootNameCache.put(file, filename);
                   else
                        filename = file.getName();
              JLabel result = (JLabel) super.getTreeCellRendererComponent(tree,
                        filename, selected, expanded, leaf, row, hasFocus);
              if (file != null)
                   Icon icon = this.iconCache.get(filename);
                   if (icon == null)
                        icon = fsv.getSystemIcon(file);
                        this.iconCache.put(filename, icon);
                   result.setIcon(icon);
              return result;
    and i run the application...File[] roots = File.listRoots();
    FileTreeNode rootTreeNode = new FileTreeNode(roots);
    tree = new JTree(rootTreeNode);
    tree.setCellRenderer(new FileTreeCellRenderer());
    can anyone please help me to sort alphabetical all the files from all the nodes...any help will be appreciated.
    Thanks.
    Calin                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    might be easier if you were to add a small pictorial
    e.g. if you have a no-arg constructor JTree, you get this
    JTree
          colors
                   blue
                   violet
                   red
                   yellow
          sports
                   basketball
                   soccer
                   football
                   hockey
          food
                   hot dogs
                   pizza
                   ravioli
                   bananasnow put it how you would like it sorted

  • Sorting a Vector of custom-made classes.

    Hi,
    I have a class Car which has the following private members:
    Strings year, make, model, engine and transmission.
    I have another class CarList which extends Vector (a vector of Car objects).
    I wish to create a method called "sortCarList()" in class CarList which will sort all of the Car objects in the vector first by "year", then by "make", then by "model". I am using a bubble sort. I tried simply sorting the Car objects in CarList by year using the "compareTo()" method. The comparison works fine, but the actual re-arranging of elements is causing me grief. Here's my current code for the "sortCarList()" method in vector class CarList:
    public void sortCarList() {
    for (int i = 0; i < (size() - 1); i++) {
    for( int j = 0; i < (size() - 1); i++)     {
         if (elementAt(j).getYear().compareTo(elementAt(j + 1).getYear()) > 0) {
    Car tempHolder;
         tempHolder = elementAt(j);
              elementAt(j) = elementAt(j + 1);
              elementAt(j + 1) = tempHolder;
    I'm getting the error (NetBeans):
    (Unexpected type)
    required: variable
    found : value
    elementAt(j) = elementAt(j + 1);
    --------------^
    - and -
    required: variable
    found : value
    elementAt(j + 1) = tempHolder;
    --------------^
    So I'm just getting the error because the way I'm trying to switch the vector elements with one another! I haven't coded in Java for a while and have since spent a college semester programming in COBOL so my reality is a bit fuddled. Is this a reference problem? Or is there something else I'm just not catching here? Help would be very appreciated!
    After I get this first simple issue out of the way, I can then start implementing a more complex sort which also takes MAKE and MODEL into consideration.
    So in the end I'm looking for this kind of sorting (fields separated for clarity):
    YEAR-MAKE-MODEL
    1969-Dodge-Super Bee
    1969-Plymouth-Road Runner
    1969-Pontiac-GTO
    1970-Buick-GSX
    1970-Chevrolet-Chevelle
    As you can see, I want the first order of sorting to be YEAR, then MAKE, then MODEL, which I assume will be a pain to do (if element 0's MODEL value lexicographically higher in the alphabet than element 1's MODEL value, it shouldn't bother sorting them because the MAKES are already in proper order).
    Message was edited by:
    incogx
    Message was edited by:
    incogx
    Message was edited by:
    incogx

    Here is an example of a Car class that implements the Comparable interface, and allows Cars to be sorted
    by year, make, and model. Since what needs to be sorted are an Integer (year) and Strings (make and model)
    which already implement the Comparable interface, this then allows a natural-order comparison to be made
    on Cars. This comparison is implemented in the compareTo method at the bottom of the class.
    There is a demo program that creates some Car data, sorts it, and prints it out. The sorting is the only
    important statement; the rest of the code is for demonstration purposes only.
    (The code is an adaption of an example in the Java Tutorial,
    http://java.sun.com/docs/books/tutorial/collections/interfaces/order.html
    The tutorial has an explanation of some of the code, and is worth reading.)
    HTH
    import java.util.*;
    public class Car implements Comparable<Car>
        private final Integer year;
        private final String make, model;
        public Car(Integer year, String make, String model)
            if (year == null || make == null || model == null)
                throw new NullPointerException();
            this.year = year;
            this.make = make;
            this.model = model;
        public int hashCode()
            return 255*year.hashCode() + 31*make.hashCode() + model.hashCode();
        public String toString()
            return year + " " + make + " " + model;
        public int compareTo(Car n)
            int lastCmp = year.compareTo(n.year);
            int nextCmp = make.compareTo(n.make);
            return (lastCmp != 0 ? lastCmp :
                nextCmp != 0 ? nextCmp :
                    model.compareTo(n.model));
    import java.util.*;
    public class CarSort
        public static void main(String[] args)
            // This creates an array of 6 Car instances
            Car nameArray[] = {
                new Car(1969, "Dodge", "Super Bee"),
                new Car(1970, "Buick", "Roadmaster"),
                new Car(1969, "Pontiac", "GTO"),
                new Car(1970, "Chevrolet", "Chevelle"),
                new Car(1970, "Buick", "GSX"),
                new Car(1969, "Plymouth", "Road Runner")
            // And this loads the Cars into a List
            List<Car> names = Arrays.asList(nameArray);
            // The 2 prior statements just create some data for this demo program
            Collections.sort(names);
            System.out.println(names);
    }

  • Changing vector registers in registers view

    I'm trying to figure out how to change the value of x86_64 vector registers such as xmm0, ymm0 in the CDT registers view. I can change scalar registers like rax just by clicking the value and changing it, but trying the same thing for a vector register doesn't change anything. Online help says to right click over the register name and click 'Change Register Value' but I don't see any such menu choice.
    This is the Mars Eclipse release.

    It does not look like you can edit those registers from the registers view. But you can from the Expressions view.
    Open the Expressions view, then add the register you want to modify, prefixed with $, for example $xmm0. You can then expand it and modify each of its field.
    Note that in the expression view, you can display all registers by using the expression =$*, so you can use this view as your registers view. It will provide alphabetical sorting automatically.
    Marc

Maybe you are looking for

  • How to get pics from old phone to new phone using iCloud.

    I just got the iPhone 5s and I used to have a 4. I backed up my pictures and contacts but the only thing that's on my new phone is my contacts. My old phone won't come back on. I need my pictures off of my old phone. My new phone says I don't have en

  • HP Laserjet P4014 tray 1 printing problems

    We have three HP Laserjet P4014 printers.  All of them are having intermittent issues with printing from Tray1 especially if the printer has been left for a time. Sometimes if paper is in tray 1 it will not take the paper from this tray only tray2. 

  • DSL down EVERY month for over a year!

    This is both sad and ridiculous that I've have had my DSL internet go down pretty much every month for over a year now and I can never ever get a reason, requested call back or decent credit/discount for all my pain, suffering, time and heartache thi

  • W530 print dialog freezes the program

    Hi,      For the past two days I have encountered strange issues. I am trying to print out documents or images either from MS word, Adobe Photoshop, Adobe acrobat reader or Firefox. No matter which program I use, the moment I click print, the program

  • 1080p through 27" Display

    HI all, just want to say ive just come over from a pc background after years, and recently just ordered an imac 27"" core i7 with 8gig ram. Ive done alot of research into this but need your expertise. i want to watch blu ray through my mac 27 display