Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2002-2013 "Neo Technology," Network Engine for Objects in Lund AB [http://neotechnology.com] This file is part of Neo4j. Neo4j is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 package org.neo4j.server.rest.repr;
 
 import java.net.URI;
 
 
 public class ListRepresentation extends Representation
 {
     protected final Iterable<? extends Representationcontent;
 
     public ListRepresentationfinal String typefinal Iterable<? extends Representationcontent )
     {
         supertype );
         this. = content;
     }
 
     public ListRepresentationRepresentationType type,
             final Iterable<? extends Representationcontent )
     {
         supertype );
         this. = content;
     }
 
     @Override
     String serializeRepresentationFormat formatURI baseUriExtensionInjector extensions )
     {
         ListWriter writer = format.serializeList );
         serializenew ListSerializerwriterbaseUriextensions ) );
         writer.done();
         return format.completewriter );
     }
 
     void serializeListSerializer serializer )
     {
         for ( Representation repr :  )
         {
             repr.addToserializer );
         }
     }
 
     @Override
     void addToListSerializer serializer )
     {
         serializer.addListthis );
     }
 
     @Override
     void putToMappingSerializer serializerString key )
     {
         serializer.putListkeythis );
     }
 
     public static ListRepresentation stringsString... values )
     {
         return string( Arrays.asListvalues ) );
     }
 
     public static ListRepresentation stringIterable<Stringvalues )
     {
                 values )
         {
             @Override
             protected Representation underlyingObjectToObjectString value )
             {
                 return ValueRepresentation.stringvalue );
             }
         } );
     }
 
     public static ListRepresentation relationshipTypesIterable<RelationshipTypetypes )
     {
                 new IterableWrapper<RepresentationRelationshipType>( types )
                 {
                     @Override
                    protected Representation underlyingObjectToObjectRelationshipType value )
                    {
                        return ValueRepresentation.relationshipTypevalue );
                    }
                } );
    }
    public static ListRepresentation numbersfinal long... values )
    {
        {
            @Override
            public Iterator<ValueRepresentationiterator()
            {
                return new PrefetchingIterator<ValueRepresentation>()
                {
                    int pos = 0;
                    @Override
                    protected ValueRepresentation fetchNextOrNull()
                    {
                        if (  >= values.length ) return null;
                        return ValueRepresentation.numbervalues[++] );
                    }
                };
            }
        } );
    }
    public static ListRepresentation numbersfinal double[] values )
    {
        return new ListRepresentation.,
                new Iterable<ValueRepresentation>()
                {
                    @Override
                    public Iterator<ValueRepresentationiterator()
                    {
                        return new PrefetchingIterator<ValueRepresentation>()
                        {
                            int pos = 0;
                            @Override
                            protected ValueRepresentation fetchNextOrNull()
                            {
                                if (  >= values.length ) return null;
                                return ValueRepresentation.numbervalues[++] );
                            }
                        };
                    }
                } );
    }
New to GrepCode? Check out our FAQ X