Package javax.time.calendar

Examples of javax.time.calendar.TimeZone$Rule


            tree = tree.get(parsedZoneId);
            ++count;
        }
       
        if (parsedZoneId != null && preparedIDs.contains(parsedZoneId)) {
            TimeZone zone = TimeZone.timeZone(parsedZoneId);
            context.setZone(zone);
            return position + parsedZoneId.length();
        } else {
            return ~position;
        }
View Full Code Here


    }

    //-----------------------------------------------------------------------
    /** {@inheritDoc} */
    public void print(Calendrical calendrical, Appendable appendable, DateTimeFormatSymbols symbols) throws IOException {
        TimeZone zone = calendrical.get(TimeZone.rule());
        if (zone == null) {
            throw new CalendricalPrintException("Unable to print TimeZone");
        }
        if (textStyle == null) {
            appendable.append(zone.getID());
        } else if (textStyle == TextStyle.FULL) {
            appendable.append(zone.getName())// TODO: Use symbols
        } else {
            appendable.append(zone.getShortName())// TODO: Use symbols
        }
    }
View Full Code Here

            int endPos = new ZoneOffsetPrinterParser("", true, true).parse(newContext, parseText, startPos);
            if (endPos < 0) {
                context.setParsed(TimeZone.rule(), TimeZone.UTC);
                return startPos;
            }
            TimeZone zone = TimeZone.of((ZoneOffset) newContext.getParsed(ZoneOffset.rule()));
            context.setParsed(TimeZone.rule(), zone);
            return endPos;
        }
       
        // parse
        String parsedZoneId = null;
        int count = 0;
        while (tree != null) {
            int nodeLength = tree.length;
            if (position + nodeLength > length) {
                break;
            }
            parsedZoneId = parseText.substring(position, position + nodeLength);
            tree = tree.get(parsedZoneId);
            ++count;
        }
       
        if (parsedZoneId != null && preparedIDs.contains(parsedZoneId)) {
            TimeZone zone = TimeZone.of(parsedZoneId);
            context.setParsed(TimeZone.rule(), zone);
            return position + parsedZoneId.length();
        } else {
            return ~position;
        }
View Full Code Here

            String segment = currTextSegment.toString();
            List<Rule> parentMatches = getMatches().peek();
            int len = parentMatches.size();
            for ( int i = 0; i < len; ++i )
            {
                Rule r = parentMatches.get( i );
                if ( r instanceof TextSegmentHandler )
                {
                    TextSegmentHandler h = (TextSegmentHandler) r;
                    try
                    {
View Full Code Here

    {

        @Override
        protected void configure()
        {
            forPattern( "bar" ).addRule( new Rule()
            {

                @Override
                public void body( String namespace, String name, String text )
                    throws Exception
View Full Code Here

            Log log = getDigester().getLogger();
            boolean debug = log.isDebugEnabled();
            for ( int i = 0; i < rules.size(); i++ )
            {
                int j = ( rules.size() - i ) - 1;
                Rule rule = rules.get( j );
                if ( debug )
                {
                    log.debug( "  Fire end() for " + rule );
                }
                try
                {
                    rule.end( namespaceURI, name );
                }
                catch ( Exception e )
                {
                    throw getDigester().createSAXException( e );
                }
View Full Code Here

   */
  public String graph() throws Exception {
    StringBuffer text = new StringBuffer();
   
    text.append("digraph M5Tree {\n");
    Rule temp = (Rule)m_ruleSet.elementAt(0);
    temp.topOfTree().graph(text);
    text.append("}\n");
    return text.toString();
  }
View Full Code Here

TOP

Related Classes of javax.time.calendar.TimeZone$Rule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.