Examples of State


Examples of org.opentripplanner.routing.core.State

        ArrayList<LineString> uShapes = new ArrayList<LineString>();
        int countEdgesOutside = 0;
        // -- determination of walkshed edges via edge states
        for (Iterator iterator = allConnectingStateEdges.iterator(); iterator.hasNext();) {
            Edge edge = (Edge) iterator.next();
            State sFrom = spt.getState(edge.getFromVertex());
            State sTo = spt.getState(edge.getToVertex());
            if ((sFrom != null) && (sTo != null)) {
                long fromTime = sFrom.getElapsedTimeSeconds();
                long toTime = sTo.getElapsedTimeSeconds();
                long dt = Math.abs(toTime - fromTime);
                Geometry edgeGeom = edge.getGeometry();
                if ((edgeGeom != null) && (edgeGeom instanceof LineString)) {
                    LineString ls = (LineString) edgeGeom;
                    // detect u-shape roads/crescents - they need to be treated separately
View Full Code Here

Examples of org.osgi.service.subsystem.Subsystem.State

    this.instigator = instigator;
  }
 
  @Override
  public Object run() {
    State state = target.getState();
    // The following states are illegal.
    if (EnumSet.of(State.INSTALL_FAILED, State.UNINSTALLED, State.UNINSTALLING).contains(state))
      throw new SubsystemException("Cannot stop from state " + state);
    // The following states must wait.
    if (EnumSet.of(State.INSTALLING, State.RESOLVING, State.STARTING, State.STOPPING).contains(state)) {
View Full Code Here

Examples of org.qi4j.api.injection.scope.State

        {
            // @State Property<String> name;
            StateDescriptor descriptor;
            descriptor = ( (StatefulCompositeDescriptor) resolution.model() ).state();

            State annotation = (State) dependencyModel.injectionAnnotation();
            String name;
            if( annotation.value().equals( "" ) )
            {
                name = resolution.field().getName();
            }
            else
            {
                name = annotation.value();
            }

            PropertyDescriptor propertyDescriptor = descriptor.getPropertyByName( name );

            // Check if property exists
            if( propertyDescriptor == null )
            {
                return null;
            }

            return new PropertyInjectionProvider( propertyDescriptor );
        }
        else if( Association.class.isAssignableFrom( dependencyModel.rawInjectionType() ) )
        {
            // @State Association<MyEntity> name;
            AssociationStateDescriptor descriptor = ( (EntityDescriptor) resolution.model() ).state();
            State annotation = (State) dependencyModel.injectionAnnotation();
            String name;
            if( annotation.value().equals( "" ) )
            {
                name = resolution.field().getName();
            }
            else
            {
                name = annotation.value();
            }
            AssociationDescriptor model = descriptor.getAssociationByName( name );

            // No such association found
            if( model == null )
            {
                return null;
            }

            return new AssociationInjectionProvider( model );
        }
        else if( ManyAssociation.class.isAssignableFrom( dependencyModel.rawInjectionType() ) )
        {
            // @State ManyAssociation<MyEntity> name;
            AssociationStateDescriptor descriptor = ( (EntityDescriptor) resolution.model() ).state();
            State annotation = (State) dependencyModel.injectionAnnotation();
            String name;
            if( annotation.value().equals( "" ) )
            {
                name = resolution.field().getName();
            }
            else
            {
                name = annotation.value();
            }
            AssociationDescriptor model = descriptor.getManyAssociationByName( name );

            // No such association found
            if( model == null )
View Full Code Here

Examples of org.richfaces.ui.model.State

  public Class<?> getType(ELContext context, Object base, Object property) {
    if (null != base && base instanceof State) {
          if (property == null) {
              throw new PropertyNotFoundException("Null property");
           }
        State state = (State)base;
        Object stateProperty = state.get(property.toString());
          if (stateProperty == null) {
              throw new PropertyNotFoundException("State Property ["+property+"] not found ");
          }
          context.setPropertyResolved(true);
          if (stateProperty instanceof ValueExpression) {
View Full Code Here

Examples of org.rssowl.core.persist.INews.State

    StringBuilder builder = getBuilder(news);
    StringBuilder search = new StringBuilder();

    String newsTitle = ModelUtils.getHeadline(news);
    boolean hasLink = news.getLink() != null;
    State state = news.getState();
    boolean isUnread = (state == State.NEW || state == State.UPDATED || state == State.UNREAD);
    String color = (news.getLabel() != null) ? news.getLabel().getColor() : null;

    /* DIV: NewsItem */
    div(builder, "newsitem");
View Full Code Here

Examples of org.sablecc.sablecc.automaton.State

                }

                for (Entry<RichSymbol, SortedSet<State>> entry : state
                        .getTransitions().entrySet()) {
                    RichSymbol richSymbol = entry.getKey();
                    State target = state.getSingleTarget(richSymbol);
                    String symbolName = richSymbol == RichSymbol.END ? "end"
                            : richSymbol.getSymbol().getSimpleName();

                    mTransitionStateSingleton.newTransitionTarget(symbolName,
                            "" + target.getId());
                }

                try {
                    BufferedWriter bw = new BufferedWriter(new FileWriter(
                            new File(packageDirectory, "S_" + state.getId()
                                    + ".java")));

                    bw.write(mTransitionStateSingleton.toString());
                    bw.close();
                }
                catch (IOException e) {
                    throw CompilerException.outputError("S_" + state.getId()
                            + ".java", e);
                }
            }
        }

        for (Marker marker : lexer.getMarkers()) {
            mLexer.newMarkerDeclaration(marker.getName());
            mLexer.newSetMarkerDeclaration(marker.getName());
            mLexer.newAcceptMarkerDeclaration(marker.getName());
        }

        for (Production production : parser.getGrammar().getProductions()) {

            String production_CamelCaseName = to_CamelCase(production.getName());

            mNode.newNodeProductionTypeEnumEntry(production_CamelCaseName);

            // if production is not a single anonymous alternative
            if (production.getAlternatives().size() > 1
                    || !production.getAlternatives().iterator().next()
                            .getName().equals("")) {

                MProduction mProduction = new MProduction(
                        production_CamelCaseName);

                if (destinationPackage.equals("")) {
                    mProduction.newDefaultPackage(globalIndex.getLanguage()
                            .get_camelCaseName());
                }
                else {
                    mProduction.newSpecifiedPackage(globalIndex.getLanguage()
                            .get_camelCaseName(), destinationPackage);
                }

                if (production_CamelCaseName.indexOf('$') == -1) {
                    mProduction.newNamedProductionHeader();
                }
                else {
                    mProduction.newAnonymousProductionHeader();
                }

                try {
                    BufferedWriter bw = new BufferedWriter(new FileWriter(
                            new File(packageDirectory, "N"
                                    + production_CamelCaseName + ".java")));

                    bw.write(mProduction.toString());
                    bw.close();
                }
                catch (IOException e) {
                    throw CompilerException.outputError("N"
                            + production_CamelCaseName + ".java", e);
                }
            }

            for (Alternative alternative : production.getAlternatives()) {
                String alt_CamelCaseName = to_CamelCase(alternative.getName());
                String alt_CamelCaseFullName = production_CamelCaseName
                        + (alt_CamelCaseName.equals("") ? "" : "_"
                                + alt_CamelCaseName);
                boolean altIsPublic = alt_CamelCaseFullName.indexOf('$') == -1;
                boolean altExtendsNode = alt_CamelCaseFullName.indexOf('_') == -1;

                MAlternative mAlternative = new MAlternative(
                        alt_CamelCaseFullName);

                mAlternative.newAltProdType(production_CamelCaseName);

                if (altIsPublic) {
                    mWalker.newWalkerIn(alt_CamelCaseFullName);
                    mWalker.newWalkerCase(alt_CamelCaseFullName);
                    mWalker.newWalkerOut(alt_CamelCaseFullName);
                    mAlternative.newAltNormalApply();
                }
                else {
                    mAlternative.newAltAnonymousApply();
                }

                if (destinationPackage.equals("")) {
                    mAlternative.newDefaultPackage(globalIndex.getLanguage()
                            .get_camelCaseName());
                }
                else {
                    mAlternative.newSpecifiedPackage(globalIndex.getLanguage()
                            .get_camelCaseName(), destinationPackage);
                }

                mNode.newNodeInternalTypeEnumEntry(alt_CamelCaseFullName);
                if (altIsPublic) {
                    mNode.newNodeTypeEnumEntry(alt_CamelCaseFullName);
                    mAlternative.newPublic();
                    mAlternative.newNamedAltType();
                }
                else {
                    mAlternative.newAnonymousAltType();
                }

                if (altExtendsNode) {
                    mAlternative.newAlternativeNodeParent();
                }
                else {
                    mAlternative
                            .newAlternativeNamedParent(production_CamelCaseName);
                }

                boolean altHasPublicConstructor = true;
                for (Element element : alternative.getElements()) {
                    String element_CamelCaseName = to_CamelCase(element
                            .getName());
                    String element_CamelCaseType = null;
                    boolean elementIsEndToken;
                    boolean elementIsPublicReadable;
                    boolean elementIsPublicWritable;
                    if (element instanceof TokenElement) {
                        TokenElement tokenElement = (TokenElement) element;
                        if (tokenElement.getToken().getName().equals("$end")) {
                            elementIsEndToken = true;
                            elementIsPublicReadable = false;
                            elementIsPublicWritable = false;
                        }
                        else {
                            MatchedToken matchedToken = context
                                    .getMatchedToken(tokenElement.getToken()
                                            .getName());
                            if (matchedToken instanceof NameToken) {
                                NameToken nameToken = (NameToken) matchedToken;
                                element_CamelCaseType = nameToken
                                        .get_CamelCaseName();
                            }
                            else {
                                AnonymousToken anonymousToken = (AnonymousToken) matchedToken;

                                element_CamelCaseType = ""
                                        + anonymousToken.get_CamelCaseName();
                            }

                            elementIsEndToken = false;
                            elementIsPublicReadable = altIsPublic
                                    && element_CamelCaseName.indexOf('$') == -1;
                            elementIsPublicWritable = elementIsPublicReadable
                                    && element_CamelCaseType.indexOf('$') == -1;
                        }
                    }
                    else {
                        ProductionElement productionElement = (ProductionElement) element;
                        element_CamelCaseType = to_CamelCase(productionElement
                                .getProduction().getName());

                        elementIsEndToken = false;
                        elementIsPublicReadable = altIsPublic
                                && element_CamelCaseName.indexOf('$') == -1;
                        elementIsPublicWritable = elementIsPublicReadable
                                && element_CamelCaseType.indexOf('$') == -1;
                    }

                    if (!elementIsPublicWritable) {
                        altHasPublicConstructor = false;
                    }

                    if (elementIsEndToken) {
                        mAlternative.newEndConstructorParameter();
                        mAlternative.newEndContructorInitialization();

                        mAlternative.newEndElementDeclaration();
                        mAlternative.newEndElementAccessor();

                        mAlternative.newEndChildApply();
                    }
                    else {
                        mAlternative.newNormalConstructorParameter(
                                element_CamelCaseType, element_CamelCaseName);
                        mAlternative
                                .newNormalContructorInitialization(element_CamelCaseName);

                        mAlternative.newNormalElementDeclaration(
                                element_CamelCaseType, element_CamelCaseName);
                        mAlternative.newNormalElementAccessor(
                                element_CamelCaseType, element_CamelCaseName);

                        mAlternative.newNormalChildApply(element_CamelCaseName);

                        if (elementIsPublicReadable) {
                            MPublicElementAccessor publicElementAccessor = mAlternative
                                    .newPublicElementAccessor(element_CamelCaseName);
                            if (elementIsPublicWritable) {
                                publicElementAccessor
                                        .newPublicElementType(element_CamelCaseType);
                            }
                            else {
                                publicElementAccessor.newTokenElementType();
                            }
                        }
                    }
                }

                if (altHasPublicConstructor) {
                    mAlternative.newPublicConstructor();
                }

                try {
                    BufferedWriter bw = new BufferedWriter(new FileWriter(
                            new File(packageDirectory, "N"
                                    + alt_CamelCaseFullName + ".java")));

                    bw.write(mAlternative.toString());
                    bw.close();
                }
                catch (IOException e) {
                    throw CompilerException.outputError("N"
                            + alt_CamelCaseFullName + ".java", e);
                }
            }
        }

        for (LRState state : parser.getStates()) {
            MLrStateSingleton mLrStateSingleton = mParser
                    .newLrStateSingleton(state.getName());

            for (Entry<Token, LRState> entry : state.getTokenTransitions()
                    .entrySet()) {
                Token token = entry.getKey();
                LRState target = entry.getValue();

                if (token.getName().equals("$end")) {
                    mLrStateSingleton.newEndTokenLrTransitionTarget(target
                            .getName());
                }
                else {
                    MatchedToken matchedToken = context.getMatchedToken(token
                            .getName());
                    String element_CamelCaseType;
                    if (matchedToken instanceof NameToken) {
                        NameToken nameToken = (NameToken) matchedToken;
                        element_CamelCaseType = nameToken.get_CamelCaseName();
                    }
                    else {
                        AnonymousToken anonymousToken = (AnonymousToken) matchedToken;

                        element_CamelCaseType = ""
                                + anonymousToken.get_CamelCaseName();
                    }

                    mLrStateSingleton.newNormalTokenLrTransitionTarget(
                            element_CamelCaseType, target.getName());
                }
            }

            for (Entry<Production, LRState> entry : state
                    .getProductionTransitions().entrySet()) {
                Production production = entry.getKey();
                LRState target = entry.getValue();

                String production_CamelCaseName = to_CamelCase(production
                        .getName());
                mLrStateSingleton.newProductionLrTransitionTarget(
                        production_CamelCaseName, target.getName());
            }

            Map<Integer, MDistance> distanceMap = new LinkedHashMap<Integer, MDistance>();
            boolean isLr1OrMore = false;
            for (Action action : state.getActions()) {
View Full Code Here

Examples of org.springframework.batch.core.job.flow.State

     *
     * @param step the next step after this transition
     * @return a FlowBuilder
     */
    public FlowBuilder<Q> to(Step step) {
      State next = parent.createState(step);
      parent.addTransition(pattern, next);
      parent.currentState = next;
      return parent;
    }
View Full Code Here

Examples of org.springframework.webflow.engine.State

  }

  public void testStateExceptionHandlingExceptionInEndState() {
    FlowBuilder builder = new AbstractFlowBuilder() {
      public void buildStates() throws FlowBuilderException {
        State state = new EndState(getFlow(), "end");
        state.getEntryActionList().add(new AbstractAction() {
          protected Event doExecute(RequestContext context) throws Exception {
            throw new NullPointerException("failing");
          }
        });
        new TransitionableState(getFlow(), "showError") {
View Full Code Here

Examples of org.springframework.xd.dirt.core.DeploymentUnitStatus.State

    }
  }

  private boolean waitForUndeploy(StreamDefinition definition) {
    streamDeployer.undeploy(definition.getName());
    State state = streamResourceStateVerifier.waitForUndeploy(definition.getName());
    return state.equals(State.undeployed);
  }
View Full Code Here

Examples of org.sumus.dwh.datastore.State

    }

    private void addTupleInCube(String path, ArrayList<String> arrayfiles) throws IOException {
        ReaderFile readerfile;
        AfferenceCoupling afferencecoupling;
        State state;
        Tuple factShip;
        readerfile = new ReaderFile(path);
        afferencecoupling = new AfferenceCoupling(arrayfiles, readerfile);
       
        Context context = buildPackageContext();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.