Ignore:
Timestamp:
06/26/13 13:27:31 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • use java annotations to mark classes and fields to be used when:
    • using java classes with ReflectionAccess? to represent remote objects with FramsClass? description found by "info ..." requests
    • to build up FramsClass? representation of objects not present at remote server
  • allow using primitive types (instead of wraping counterparts) in reflected classes
  • rework FramsClass? creation process (add FramsClassBuilder?)
  • add more tests

CHANGELOG:
Prepare model.World class.

Minor change.

Use primitive types for Genotype and Creature classes.

Use primitive types in model.Neuro* classes.

Use primitive types in model.Joint* classes.

Use primitive types in model.Part* classes.

Fix primitive values.

Extract FramsClassBuilder?.

Add tests of Model classes.

More fixes.

Refactorize out ParamCandidate?.

Several fixes.

Fix all regressions after introducing annotations.

Use annotations throughout the project.

Add exception classes.

Improve creation of FramsClass?.

More changes.

Many changes regarding annotations.

Annotate classes in com.framsticks.model package.

Remove manual FramsClass? constructor.

Construct FramsClass? for Creature. Add test.

Add default values to the ParamAnnotation?.

Add ParamBuilderTest? and ParamAnnotation?.

Add FramsClassAnnotation?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/params/ListSource.java

    r84 r86  
    11package com.framsticks.params;
    22
     3import java.util.ArrayList;
    34import java.util.Iterator;
    45import java.util.List;
     
    78
    89        private Iterator<String> iterator = null;
    9     //private final List<String> source;
     10        //private final List<String> source;
    1011
    1112        public ListSource(List<String> source) {
    12         //this.source = source;
    13         iterator = source.iterator();
     13                //this.source = source;
     14                iterator = source.iterator();
    1415        }
    1516
    16     @Override
     17        @Override
    1718        public String getFilename() {
    1819                return "<net>";
    1920        }
    2021
    21     @Override
    22     public String readLine() {
    23         assert iterator != null;
     22        @Override
     23        public String readLine() {
     24                // if (iterator == null) {
     25                //      return null;
     26                // }
     27                assert iterator != null;
    2428                if (iterator.hasNext()) {
    2529                        return iterator.next();
     
    2832        }
    2933
    30     @Override
    31     public String demangleInclude(String include) {
     34        @Override
     35        public String demangleInclude(String include) {
    3236                return null;
    3337        }
    3438
    35     @Override
    36     public SourceInterface openInclude(String include) {
     39        @Override
     40        public SourceInterface openInclude(String include) {
    3741                return null;
    3842        }
    3943
    40     @Override
    41     public void close() {
    42         iterator = null;
     44        @Override
     45        public void close() {
     46                iterator = null;
     47        }
     48
     49        public static ListSource createFrom(String... lines) {
     50                List<String> list = new ArrayList<String>();
     51                for (String l : lines) {
     52                        list.add(l);
     53                }
     54                return new ListSource(list);
     55        }
     56
     57        @Override
     58        public boolean isClosed() {
     59                return iterator == null;
    4360        }
    4461}
Note: See TracChangeset for help on using the changeset viewer.