OrderedList sorted by String length

i am trying to create an orderedlist of strings in ascending order by length. I am a little shacky on comparables this is what i have so far. I think i have to implement the Comparable interface and use length as the comparison in the Word class but im not entirely sure how to do this. So for example lion, pig, crocodile should look like ....
pig
lion
crocodile
in the ordered list... any help is appreciated.
WORD.JAVA
public class Word
     private String word, description;
     private int startPos, direction, used;
     public static final int NOTUSED = 0;
     public static final int USED = 1;
     public static final int DOWN= 0;
     public static final int ACROSS= 1;
     public Word(String w, String d)
          word = w;
          description = d;
          //startPos = num;
          //direction = dir;
          //used = use;
     public void setDirection(int dir)
          direction = dir;
     public int getDirection()
          return direction;
     public void setUsed(int use)
          used = use;
     public int getUsed()
          return used;
     public void setPos(int num)
          startPos = num;
     public int getPos()
          return startPos;
     public String getDescription()
          return description;
     public String getWord()
          return word;
     public String toString()
          String str = "";
          str = word+": "+description;
          return str;
ORDEREDLIST.JAVA
import java.util.*;
public class OrderedLinkedList
     private class LinearNode
          private LinearNode next = null;
          private Comparable element = null;
          public LinearNode(Comparable c)
               element = c;
          public LinearNode getNext()
               return next;
          public void setNext(LinearNode n)
               next = n;
          public Comparable getElement()
               return element;
          public void setElement(Comparable c)
               element = c;
          public String toStringRecursive()
               String result = element.toString();
               if(next == null)
                    return null;
               else
                    return result + " " + next.toStringRecursive();
          public void add(LinearNode node)
               if(node.element.compareTo(next.element) <= 0)
                    node.next = next;
                    next = node;
               else
                    next.add(node);
     private LinearNode first = null;
     private LinearNode last = null;
     private int count = 0;
     public void add(Comparable c)
          LinearNode node = new LinearNode(c);
          if(isEmpty())
               first = node;
               last = node;
          else if(count == 1)//(first == last)
               if(c.compareTo(first.getElement()) > 0) //one in list add to end
                    last = node;
                    first.setNext(last);
               }else                                   //one in list add to start
                    first = node;
               first.setNext(last);
          else if(c.compareTo(first.getElement()) <= 0) //multiple in list add to start
               node.setNext(first);
               first = node;
          }else if(c.compareTo(last.getElement()) > 0) //multiple in list add to end
               last.setNext(node);
               last = node;
          }else
               first.add(node);
          count++;
     public Comparable remove(Comparable target) throws EmptyStackException,NoSuchElementException
          if(isEmpty())
               throw new EmptyStackException();
          boolean found = false;
          LinearNode previous = null;
          LinearNode current = first;
          while(current != null && !found)
               if(target.equals(current.getElement()))
                         found = true;
               else{
                    previous = current;
                    current = current.getNext();
          if(!found)
               throw new NoSuchElementException();
          if(size() == 1)
               first = last = null;
          else if (current.equals(first))
               first = current.getNext();
               else if(current.equals(last))
                         last = previous;
                         last.setNext(null);
                    else
                         previous.setNext(current.getNext());
          count--;
          return current.getElement();
     public boolean isEmpty()
          return count == 0;
          //return first == null;
     public String toString()
          String result = "";
          LinearNode current = first;
          while(current != null)
               result += current.getElement();
               current = current.getNext();
          return result;
     public int size()
          return count;
}

That's rather a lot of code - and much of it has nothing obvious to do with sorting strings by length. Also I can't see where you have implemented the Comparable interface.
You are talking about java.lang.Comparable, right? In that case some class (Word?) has to be declared as "implements Comparable".
Another way to do this is is to have an instance of Comparator that you use when you create an ordered collection like a TreeSet.
Have you read the JavaWorld article: [http://www.javaworld.com/javaworld/jw-12-2002/jw-1227-sort.html]. It is rather old now and doesn't make any use of generics. But it gives examples of a simple collection - a list - being sorted using Collections.sort(). Both the Comparable and Comparator approaches are illustrated

Similar Messages

  • Problem in sorting numeric string

    hii
    i have created one method using comparator and passed a list with list of strings as argument to sort method of Collections class.The string ,which is combined a string and numeric value for example A1,A2,A11,A3 .....So i wanted the result as A1,A2,A3..A11,A12... and so on as final output.but when i print the output ,they are sorted as A1,A11,A12....A2,A3....so i learned from javadoc why those are sorted as like since comparator is using charAt() method while making override compare() method.but i am not expected this sorting for my application. i need sorting output as A1,A2,A3...A11,A12.....How to compare a string with another string both have combination of string and number using java?
    if any one know the logic reply me.
    i have pasted my code,if any changes have to be made only in this code,correct the code.
    package sample.sorting;
    import java.util.ArrayList;
    import java.util.Collections;
    import java.util.Comparator;
    import java.util.List;
    public class SortString {
         public static List<String> sort(List<String> data) {
              Collections.sort(data,new Comparator<String>(){
                   public int compare(String s1,String s2) {
                        return s1.compareTo(s2)     ;
              return data;
         public static void main(String[] args) {
              List<String> sortList     = new ArrayList<String>();
              sortList.add("A1");
              sortList.add("A3");
              sortList.add("A2");
              sortList.add("A9");
              sortList.add("A11");
              sortList.add("A6");
              List<String> sort = sort(sortList);
              for(String str : sort) {
                   System.out.println("STR :: "+str); // O/P : A1,A11,A2,A3,A6... but expected O/P : A1,A2,A3..A11.
    }thanks in advance.
    with regards
    Oasisderts
    Edited by: oasisdesert on Dec 29, 2009 4:15 AM

    In the compare method of the comparator, check if two Strings have equal length, if so compare them as normal, otherwise treat them as a separate case.
    e.g. uncompiled return s1.length == s2.length ? s1.compareTo(s2) : if(s1.length < s2.length) -1 else 1;Mel

  • Questions on: 1) Last Update; 2) Max String Length; 3) dynamic table keys

    Hi:
    - I am currently prototyping a plug-in but I have some questions:
    - 1) At the 'All Metrics' table, what is the intent of the 'Last Upload' field,
    and how is this field updated?
    - I have created some metrics but for some metrics the 'Last Upload' field
    has a timestamp but for other metrics there is no data.
    As far as I know, the metrics are similar but I do not know why the behaviour is different.
    - 2) Is there a maximum string length that the Oracle agent can accept?
    - I have a script which just returns all the environment variables into one cell.
    In emagent.trc, the Oracle agent issues the following warning:
    2009-08-27 12:38:47 Thread-76336 WARN upload: Truncating value of "STRING_VALUE" from "AGENT_HOME=
    - Is the truncation an issue?
    - 3) I have created some dynamic tables from performing an snmp walk, but the key that I use
    is the index of the SNMP table. The data is collected correctly, but I am not sure that using
    the table index as the key for OEM is a good idea because the metrics are stored according to the SNMP table index.
    Should the OEM key be the something like 'object name' instead of the index number from performing an SNMP walk ?
    For example, when I click a metric, the metric name is: Sensor Index 1.
    But should it not be something like 'Fan #1' ?
    Thanks John

    Metrics are collected at certain intervals, the Last Upload field indicates the date and time of the last time a metric collection was uploaded. The quicker the interval, the more recent that date should be. If you don't specify a CollectionItem in your default collection file for your metrics, they won't be collected or uploaded.
    If your metric column is a STRING type, it is stored in a VARCHAR2(4000)
    I'm not sure I understand your last problem... You have a table metric with a set of columns. The column you use as the key is just some tracking index which doesn't really mean anything. As long as your key column(s) make the row unique, the agent will be satisfied. If you want something more meaningful as your key, then it's something you will have to inject into your dataset if it isn't already there.

  • Finding the key according to string length in java.util.Properties

    Finding the key according to string length in java.util.Properties.
    I know only String length only.

    i need to retrieve the values from the java.util.properties.
    we know that we need to give the key value in order to retrieve the datas.
    but my problem is i will give the length of the key instead of giving the key value but i need to retrieve the datas according to the length of the key.

  • While trying to invoke the method java.lang.String.length() of an object loaded from local variable 'payload'

    Hi,
    Our PI is getting data from WebSphere MQ and pushing to SAP. So our sender CC is JMS and receiver is Proxy. Our PI version is 7.31.
    Our connectivity between the MQ is success but getting the following error while trying to read the payload.
    Text: TxManagerFilter received an error:
    [EXCEPTION]
    java.lang.NullPointerException: while trying to invoke the method java.lang.String.length() of an object loaded from local variable 'payload'
           at com.sap.aii.adapter.jms.core.channel.filter.ConvertJmsMessageToBinaryFilter.filter(ConvertJmsMessageToBinaryFilter.java:73)
           at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:204)
           at com.sap.aii.adapter.jms.core.channel.filter.InboundDuplicateCheckFilter.filter(InboundDuplicateCheckFilter.java:348)
           at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:204)
    I have searched SDN but couldn't fix it. Please provide your suggestion.
    With Regards
    Amarnath M

    Hi Amarnath,
    Where exactly you are getting this error?
    If you are getting at JMS Sender communication channel, try to stop and start the JMS communication channel and see the status, also use XPI Inspector to get the exact error log.
    for reference follow below blogs:
    Michal's PI tips: ActiveMQ - JMS - topics with SAP PI 7.3
    Michal's PI tips: XPI inspector - help OSS and yourself
    XPI Inspector

  • Approval task SP09: Evaluation of approvalid failed with Exception: while trying to invoke the method java.lang.String.length() of an object loaded from local variable 'aValue'

    Hi everyone,
    I just installed SP09 and i was testing the solution. And I found a problem with the approvals tasks.
    I configured a simple ROLE approval task for validate add event. And when the runtime executes the task, the dispatcher log shows a error:
    ERROR: Evaluation of approvalid failed with Exception: while trying to invoke the method java.lang.String.length() of an object loaded from local variable 'aValue'
    And the notifications configured on approval task does not start either.
    The approval goes to the ToDO tab of the approver, but when approved, also the ROLE stays in "Pending" State.
    I downgraded the Runtime components to SP08 to test, and the approvals tasks works correctly.
    Has anyone passed trough this situation in SP09?
    I think there is an issue with the runtime components delivered with this initial package of SP09.
    Suggestions?

    Hi Kelvin,2016081
    The issue is caused by a program error in the Dispatcher component. A fix will be provided in Identity Management SP9 Patch 2 for the Runtime component. I expect the patch will be delivered within a week or two.
    For more info about the issue and the patch please refer to SAPNote 2016081.
    @Michael Penn - I might be able to assist if you provide the ticket number
    Cheers,
    Kristiyan
    IdM Development

  • Using "string-length" in STANDARD receiver determ xpath rule in PI 7.11

    Hi
    I have a situation, where I need to call one system, if the businesspartner value is 6 characters long and call an other system, if the length is different from 6 characters.
    I am trying to use the standard receiver determination by entering this rule, but it does not work:
    (string-length(/p1:ValidateUserRequest/Businesspartner)) = 6          ->   system1
    (string-length(/p1:ValidateUserRequest/Businesspartner)) not=  6   ->   system2
    Is there no way of sprucing up the standard xpath expression in the way I try?
    What alternatives do I have?
    Mikael

    Hi,
    Please try giving the XPath expression as given below:
    /p1:ValidateUserRequest [string-length(Businesspartner) = 6]  system1
    /p1:ValidateUserRequest [string-length(Businesspartner) != 6] system 2
    Please use square brackets before "string" and after "6"...its not getting displayed in my reply...:-(
    Rgds,
    Lekshmi.
    Edited by: Lekshmi N on Jan 6, 2010 12:29 PM

  • How to increase the string length of an uploaded file

    Hi,
    i use a abap webser where i've uploaded some JAR files into the mime repository.
    Unfortunately the string length is limited by 40 characters and so longer file names are cut.
    How can I increase the default string length? Does somebody know a workaround?
    Thanks.
    Edited by: Martin Gardyan on Oct 22, 2008 9:48 AM

    what i guess copying those jars should not create this problem.U just try in db using
    "ALTER TABLE <table_name> MODIFY <column_name> VARCHAR2(<new, larger length>)"
    may be it works.
    Regards,
    Anu

  • Sort a string :: Please help.

    Hello Everyone,
    I am having this very simple problem of sorting a String. please help.
         static String sortString(String str){
              List list = Arrays.asList(str);                    
              Collections.sort(list);
              for(int i=0, n=list.size();i<n;i++){
                   System.out.println(","+ list.get(i));
    The function is supposed to take a String and sort it & print it out. This should be simple. Where am I making mistakes? Please help!!

    Hello Everyone,
    I am having this very simple problem of sorting a String. please help.
         static String sortString(String str){
              List list = Arrays.asList(str);                    
              Collections.sort(list);
              for(int i=0, n=list.size();i<n;i++){
                   System.out.println(","+ list.get(i));
                   return str;
    The function is supposed to take a String and sort it & print it out. This should be simple. Where am I making mistakes? Please help!!

  • String length limitation on setString() in prepared statement

    Hi,
    Is any body aware of the length of string that can be passed to setString() method of prepared statement. I am getting an error "Data size bigger than max size for this type" if the string length is more than 2000 chars. I am using jdk 1.2.2 for running the application.
    Thanks in advance.
    Nihar.

    Please use the following method. It worked for me.
    PreparedStatement pstmt = ......;
    String str = .....;
    pstmt.setObject(index,str,java.sql.Types.LONGVARCHAR);
    Ranjan.

  • How to know the total string length of a range of cell in excel sheets

    Hi,
           I am working on Excel automation. I want to read data of collection of cells from excel for that i need to know the total string length in one shot.
    Can anyone suggest me the answer for this

    Still not sure about your requirements, but how about this
    SQL> CREATE OR REPLACE FUNCTION get_max_length(p_table in varchar2, p_col in varchar2) return pls_integer
      2  is
      3    v_cnt pls_integer;
      4  begin
      5    execute immediate 'select max(length('||p_col||')) from '||p_table into v_cnt;
      6    return v_cnt;
      7  end get_max_length;
      8  /
    Function created.
    SQL>
    SQL> SELECT COLUMN_NAME,
      2         DATA_LENGTH,
      3         get_max_length(TABLE_NAME, COLUMN_NAME) max_length
      4  FROM USER_TAB_COLUMNS
      5  WHERE TABLE_NAME='EMP'
      6  AND DATA_TYPE like '%CHAR%'
      7  ;
    COLUMN_NAME                    DATA_LENGTH MAX_LENGTH
    ENAME                                   10          6
    JOB                                      9          9
    SQL>

  • Calculating string length

    hi experts,
    How to calculate string length from driver program. Is there any function module to do it. Please help me. In my application, i will get the input from user and calculate string length and process it. Please help me.

    Hi,
    <<removed>>
    Umang Mehta
    Edited by: kishan P on Oct 9, 2010 3:42 PM

  • In ODSI 10gR3 fn:string-length() not pushing down to db (SR: 7714015.993)

    Under ALDSP 2.5, the following XQuery...
    where string-length($medacf) = 0 or $medacf = $acf/column_name
    ...used to generate this SQL:
    where ((? = 0) OR (? = t1."COLUMN_NAME"))
    However, under ODSI 10gR3, the where clause is missing. Here's the query plan:
    <?xml version="1.0"?>
    <FLWOR>
    <return>
    <elementConstructor name="UserGroup" tip="{ld:PhysicalLayer/UserProfile/UserGroup}UserGroup">
    <elementConstructor field="(0)" name="UserID" from="$f7815">
    </elementConstructor>
    <elementConstructor field="(1)" name="GroupID" from="$f7815">
    </elementConstructor>
    </elementConstructor>
    </return>
    <where sqlstop="Unable to generate SQL for XQuery expression: Cannot generate SQL for the function {http://www.bea.com/xquery/xquery-operators}integer-equal with parameters (Parameter,INTEGER), (Constant,INTEGER). There is no equivalent SQL for this function in general or with these particular parameter kinds/types. ">
    <operator ns="op" name="boolean-or" tip="{http://www.w3.org/2004/07/xpath-operators}boolean-or">
    <EQ sqlstop="Cannot generate SQL for the function {http://www.bea.com/xquery/xquery-operators}integer-equal with parameters (Parameter,INTEGER), (Constant,INTEGER). There is no equivalent SQL for this function in general or with these particular parameter kinds/types. " tip="{http://www.bea.com/xquery/xquery-operators}integer-equal">
    <operator ns="fn" name="string-length" tip="{http://www.w3.org/2004/07/xpath-functions}string-length">
    <variable name="__fparam0" kind="EXTERNAL">
    </variable>
    </operator>
    <constant>
    <![CDATA[[integer 0]]]>
    </constant>
    </EQ>
    <EQ tip="{http://www.bea.com/xquery/xquery-operators}string-equal">
    <variable name="__fparam0" kind="EXTERNAL">
    </variable>
    <variable name="(2)" from="$f7815" kind="extracted">
    </variable>
    </EQ>
    </operator>
    </where>
    <for name="$f7815">
    <source ns="fn-bea" name="UsrProfDataSource" sqlwarning="Generated SQL query does not have a WHERE clause. This may cause the query to take longer to finish and use excessive memory resources." kind="relational" tip="UsrProfDataSource">
    <![CDATA[SELECT UPPER(t1."USER_ID") AS c1, t1."GRP_ID" AS c2, t1."USER_ID" AS c3
    FROM "USRPROF"."USER_GRP" t1]]>
    </source>
    </for>
    </FLWOR>

    We have found that in ODSI 10gR3, the code pattern below is not pushed down if $logicalExpression is an expression that compares two atomic values and one of the values is a constant (used to work in ALDSP 2.5):
    where $logicalExpression or $table/column = $input
    Sample code that is not pushed down as expected:
    where fn:string-length($accountNumber) _<= 0_ or $account/ACCT_NUM = $accountNumber
    where fn:empty($accountNumber) or $accountNumber _= ''_ or $account/ACCT_NUM = $accountNumber
    where fn:empty($clientId) or $clientId _= 0_ or $account/CLIENT_ID = $clientId
    where fn:empty($effectiveDate) or $effectiveDate _= xs:date('0001-01-01')_ or $account/ACCT_EFF_DT = $effectiveDate
    We have also found that a workaround is to tweak the code and replace $logicalExpression with something that can be pushed down and functionally equivalent (using fn:not, fn-bea:fence, fn:exactly-one, etc.).
    Code that works:
    where fn:not(fn:string-length($accountNumber) > 0) or $account/ACCT_NUM = $accountNumber
    where fn-bea:fence(fn:string-length($accountNumber) <= 0) or $account/ACCT_NUM = $accountNumber
    where fn:exactly-one(fn:string-length($accountNumber) <= 0) or $account/ACCT_NUM = $accountNumber
    After examining the query plans, it appears to me (please correct me if any of these is not true):
    - Comparators for atomic types ({http://www.bea.com/xquery/xquery-operators} integer-less-than-or-equal, string-equal, date-equal, etc.) are not pushed down if they are used to compare anything with a constant
    - An "or" operation ({http://www.w3.org/2004/07/xpath-operators} boolean-or) is not pushed down if any of its operands cannot be pushed down
    - fn:not, fn-bea:fence, and fn:exactly-one can be pushed down even if their operand cannot be pushed down
    So the question is, why comparators are not pushed down when constants are involved? Is this a bug?
    Thanks!
    -r.

  • Regular Expressions with Unicode Strings - length restriction?

    Hi,
    I can't quite figure this one out. I am checking a String for the presence of a URL.. more specifically, a jpg or gif URL.
    Anyway, the following reg exp will work fine for me. However, when testing with unicode data (chinese text) the expression will only work up to a certain string length. Here's an example:
    boolean isURL = text.matches(".*http\\S*(jpg|gif).*");
    My thought is that since Unicode data takes up more space, there a limitation to dealing with Strings. Does anyone know what that number is? Or, is there another reason the reg exp fails??
    thanks,
    joe
    Example::
    This works for any length String I throw at it using standard ASCII text.. But a unicode string of a certain length won't recognize the URL (I doubt I can simply paste my example here and have it turn out correctly..)
    DOESN'T WORK: (length is reported via text.length() as 344
    "FWD: test_tancy: FWD: tancy: FWD: supporter:
    &#27973;&#28129;&#33394;&#24425;&#36896;&#28165;&#20937;
    &#35201;&#35753;&#23621;&#25152;&#30475;&#36215;&#26469;&#28165;&#29245;&#20937;&#24555;&#65292;&#21487;&#37319;&#29992;&#20197;&#30333;&#33394;&#20026;&#20027;&#35843;&#30340;&#24067;&#32622;&#12290;&#30333;&#33394;&#19981;&#20294;&#33021;&#22686;&#21152;&#31354;&#38388;&#24863;&#65292;&#36824;&#33021;&#33829;&#36896;&#26126;&#24555;&#23425;&#38745;&#30340;&#27668;&#27675;&#65292;&#35753;&#20154;&#24773;&#32490;&#31283;&#23450;&#12290;&#21478;&#22806;&#65292;&#26377;&#24847;&#35782;&#22320;&#22686;&#28155;&#19968;&#28857;&#20919;&#33394;&#65292;&#20063;&#33021;&#20196;&#20154;&#22312;&#35270;&#35273;&#19978;&#35273;&#24471;&#30021;&#24555;&#12290;&#19981;&#36807;&#65292;&#19968;&#38388;&#25151;&#20869;&#33509;&#20840;&#37096;&#20351;&#29992;&#20919;&#33394;&#65292;&#25110;&#20840;&#37096;&#37319;&#29992;&#26262;&#33394;&#65292;&#20250;&#20351;&#20154;&#24863;&#21040;&#19981;&#23433;&#12290;&#26368;&#22909;&#26159;&#30830;&#23450;&#20027;&#33394;&#21518;&#65292;&#23567;&#38754;&#31215;&#20351;&#29992;&#20123;&#21576;&#40092;&#26126;&#23545;&#27604;&#30340;&#33394;&#24425;&#12290;&#20837;&#22799;&#36141;&#32622;&#19968;&#20123;&#33394;&#35843;&#28165;&#20937;&#30340;&#39280;&#29289;&#25670;&#35774;&#65292;&#26159;&#26368;&#30465;&#38065;&#26377;&#25928;&#30340;&#19968;&#25307;&#65292;&#22914;&#20026;&#21488;&#28783;&#25442;&#20010;&#30333;&#33394;&#28783;&#32617;&#12289;&#22312;&#27927;&#25163;&#38388;&#25918;&#19968;&#22871;&#20912;&#34013;&#33394;&#30340;&#27792;&#28020;&#29992;&#20855;&#31561;&#12290;(UU&#20026;&#24744;&#25552;&#20379;&#29983;&#27963;&#21672;&#35759;&#24182;&#31069;&#24744;&#29983;&#27963;&#24841;&#24555;&#65281;&#22914;&#19981;&#24076;&#26395;&#25171;&#25200;&#35831;&#22238;&#22797;?NO?)http://www.blah.com/servlet/mailbox?item=fc-10Tq9aljw0w9.jpg"
    WORKS: (length is reported via text.length() as 296
    "FWD: Joe: &#35201;&#35753;&#23621;&#25152;&#30475;&#36215;&#26469;&#28165;&#29245;&#20937;&#24555;&#65292;&#21487;&#37319;&#29992;&#20197;&#30333;&#33394;&#20026;&#20027;&#35843;&#30340;&#24067;&#32622;&#12290;&#30333;&#33394;&#19981;&#20294;&#33021;&#22686;&#21152;&#31354;&#38388;&#24863;&#65292;&#36824;&#33021;&#33829;&#36896;&#26126;&#24555;&#23425;&#38745;&#30340;&#27668;&#27675;&#65292;&#35753;&#20154;&#24773;&#32490;&#31283;&#23450;&#12290;&#21478;&#22806;&#65292;&#26377;&#24847;&#35782;&#22320;&#22686;&#28155;&#19968;&#28857;&#20919;&#33394;&#65292;&#20063;&#33021;&#20196;&#20154;&#22312;&#35270;&#35273;&#19978;&#35273;&#24471;&#30021;&#24555;&#12290;&#19981;&#36807;&#65292;&#19968;&#38388;&#25151;&#20869;&#33509;&#20840;&#37096;&#20351;&#29992;&#20919;&#33394;&#65292;&#25110;&#20840;&#37096;&#37319;&#29992;&#26262;&#33394;&#65292;&#20250;&#20351;&#20154;&#24863;&#21040;&#19981;&#23433;&#12290;&#26368;&#22909;&#26159;&#30830;&#23450;&#20027;&#33394;&#21518;&#65292;&#23567;&#38754;&#31215;&#20351;&#29992;&#20123;&#21576;&#40092;&#26126;&#23545;&#27604;&#30340;&#33394;&#24425;&#12290;&#20837;&#22799;&#36141;&#32622;&#19968;&#20123;&#33394;&#35843;&#28165;&#20937;&#30340;&#39280;&#29289;&#25670;&#35774;&#65292;&#26159;&#26368;&#30465;&#38065;&#26377;&#25928;&#30340;&#19968;&#25307;&#65292;&#22914;&#20026;&#21488;&#28783;&#25442;&#20010;&#30333;&#33394;&#28783;&#32617;&#12289;&#22312;&#27927;&#25163;&#38388;&#25918;&#19968;&#22871;&#20912;&#34013;&#33394;&#30340;&#27792;&#28020;&#29992;&#20855;&#31561;&#12290;(UU&#20026;&#24744;&#25552;&#20379;&#29983;&#27963;&#21672;&#35759;&#24182;&#31069;&#24744;&#29983;&#27963;&#24841;&#24555;&#65281;&#22914;&#19981;&#24076;&#26395;&#25171;&#25200;&#35831;&#22238;&#22797;?NO?)http://www.blah.com/servlet/mailbox?item=fc-10Tq9aljw0w9.jpg"

    Perhaps you should check the version of Java you are using. I am using 1.4.2_04
    public class A {
        public static void main(String[] args) throws UnsupportedEncodingException {
            String text = "FWD: test_tancy: FWD: tancy: FWD: supporter:                   " +
                    new String(new char[]{(char) 35201, (char) 35753, (char) 23621, (char) 25152, (char) 30475, (char) 36215,
                                          (char) 26469, (char) 28165, (char) 29245, (char) 20937, (char) 24555, (char) 65292,
                                          (char) 21487, (char) 37319, (char) 29992, (char) 20197, (char) 30333, (char) 33394,
                                          (char) 20026, (char) 20027, (char) 35843, (char) 30340, (char) 24067, (char) 32622,
                                          (char) 12290, (char) 30333, (char) 33394, (char) 19981, (char) 20294, (char) 33021,
                                          (char) 22686, (char) 21152, (char) 31354, (char) 38388, (char) 24863, (char) 65292,
                                          (char) 36824, (char) 33021, (char) 33829, (char) 36896, (char) 26126, (char) 24555,
                                          (char) 23425, (char) 38745, (char) 30340, (char) 27668, (char) 27675, (char) 65292,
                                          (char) 35753, (char) 20154, (char) 24773, (char) 32490, (char) 31283, (char) 23450,
                                          (char) 12290, (char) 21478, (char) 22806, (char) 65292, (char) 26377, (char) 24847,
                                          (char) 35782, (char) 22320, (char) 22686, (char) 28155, (char) 19968, (char) 28857,
                                          (char) 20919, (char) 33394, (char) 65292, (char) 20063, (char) 33021, (char) 20196,
                                          (char) 20154, (char) 22312, (char) 35270, (char) 35273, (char) 19978, (char) 35273,
                                          (char) 24471, (char) 30021, (char) 24555, (char) 12290, (char) 19981, (char) 36807,
                                          (char) 65292, (char) 19968, (char) 38388, (char) 25151, (char) 20869, (char) 33509,
                                          (char) 20840, (char) 37096, (char) 20351, (char) 29992, (char) 20919, (char) 33394,
                                          (char) 65292, (char) 25110, (char) 20840, (char) 37096, (char) 37319, (char) 29992,
                                          (char) 26262, (char) 33394, (char) 65292, (char) 20250, (char) 20351, (char) 20154,
                                          (char) 24863, (char) 21040, (char) 19981, (char) 23433, (char) 12290, (char) 26368,
                                          (char) 22909, (char) 26159, (char) 30830, (char) 23450, (char) 20027, (char) 33394,
                                          (char) 21518, (char) 65292, (char) 23567, (char) 38754, (char) 31215, (char) 20351,
                                          (char) 29992, (char) 20123, (char) 21576, (char) 40092, (char) 26126, (char) 23545,
                                          (char) 27604, (char) 30340, (char) 33394, (char) 24425, (char) 12290, (char) 20837,
                                          (char) 22799, (char) 36141, (char) 32622, (char) 19968, (char) 20123, (char) 33394,
                                          (char) 35843, (char) 28165, (char) 20937, (char) 30340, (char) 39280, (char) 29289,
                                          (char) 25670, (char) 35774, (char) 65292, (char) 26159, (char) 26368, (char) 30465,
                                          (char) 38065, (char) 26377, (char) 25928, (char) 30340, (char) 19968, (char) 25307,
                                          (char) 65292, (char) 22914, (char) 20026, (char) 21488, (char) 28783, (char) 25442,
                                          (char) 20010, (char) 30333, (char) 33394, (char) 28783, (char) 32617, (char) 12289,
                                          (char) 22312, (char) 27927, (char) 25163, (char) 38388, (char) 25918, (char) 19968,
                                          (char) 22871, (char) 20912, (char) 34013, (char) 33394, (char) 30340, (char) 27792,
                                          (char) 28020, (char) 29992, (char) 20855, (char) 31561, (char) 12290, (char) 20026,
                                          (char) 24744, (char) 25552, (char) 20379, (char) 29983, (char) 27963, (char) 21672,
                                          (char) 35759, (char) 24182, (char) 31069, (char) 24744, (char) 29983, (char) 27963,
                                          (char) 24841, (char) 24555, (char) 65281, (char) 22914, (char) 19981, (char) 24076,
                                          (char) 26395, (char) 25171, (char) 25200, (char) 35831, (char) 22238, (char) 22797}) +
                    "?NO?)http://www.blah.com/servlet/mailbox?item=fc-10Tq9aljw0w9.jpg";
            boolean isURL = text.matches(".*http\\S*(jpg|gif).*");
            System.out.println("isURL="+isURL+", length="+text.length());
    }Prints
    isURL=true, length=344

  • ORA-30352: inconsistent numeric precision or string length

    Trying to create a materialized view and am getting this error.
    ORA-30352: inconsistent numeric precision or string length
    How do I fix this?

    Mix and matching of types with my facts and dimensions. Making them the same resolved this.
    Edited by: user7853353 on Jun 18, 2012 5:33 PM

Maybe you are looking for

  • Glass separating from display "Falling Off"

    My macbook pro warranty ended in December. since I bought it i've had major problems with the display. This is my 4th screen. it's literarlly falling off - as in I can see the camera from the inside that was like last month - now the everything left

  • [SOLVED] Looking for a tiling WM with a certain feature

    I've been using openbox/pekwm for a few years I recently tried tiling window managers again (tried them a few years ago and hated them) and I'm hooked but after trying just about all of the popular ones and reading the man pages/web sites I can't fin

  • Where is the "Manage Pre-Orders" option?

    Where is the "Manage Pre-Orders" option?

  • HT1689 how can i change my imessage number

    My old number was ported over to my new phone, but it's not the number the phone is using to send/receive messages. How do I change this?

  • Bridge for assets on 2 computers

    First I'm a freelance designer, I work solo most of the time, I have a laptop and a desktop. My main issue is managing and updating my assets between systems. I've been freelancing for about 6 years now, and I've collected lots of audio, video, and i