Ignore:
Timestamp:
09/10/13 21:11:41 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • import refactorization: move Tree, Path, etc.

from core to structure package

  • initial serialization implementation
  • improve PrimeExperiment? test
  • many organizational changes and convenience improvements

CHANGELOG:
Make registry in AbstractTree? final.

Move most classes from core to structure package.

Minor changes.

Switch names of Future and FutureHandler?.

Rename ExceptionResultHandler? to ExceptionHandler?.

Rename ExceptionHandler? to ExceptionDispatcherHandler?.

Fix bug in ParamCandidate? cache.

Add missing synchronization to the BufferedDispatcher?.

Develop @Serialized support.

Rework serialization further.

Add serialization/deserialization interface to ValueParam?.

Move getStorageType and isNumeric from Param down to params hierarchy.

Minor changes.

Improve param type induction.

Add TestSerializedClass? for testing new serialization.

Add info files gor GenePool? and Population.

Add standard.expt exemplary netfile.

Add type name field to PropertiesObject?.

Use PropertiesObject? for PropertiesAccess? instead of ordinary map.

Hide getFramsClass is several more places.

More unification accross FramsClass?, Access and Path.

Add ParamCollection?.

Simplify interface for getting params from FramsClass?, Access
or Path.

Make Access.call() interface variadic.

Add arguments(args) convenience wrapper around new Object[] {args}.

Upgrade to apache.commons.lang version 3.1

Minor improvement with Response constructors.

Develop proper result printing in ClientAtServer?.

Add experimentNetsave to PrimeExperiment?.

File:
1 edited

Legend:

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

    r102 r105  
    33import com.framsticks.util.FramsticksException;
    44import com.framsticks.util.Misc;
     5import com.framsticks.util.lang.Casting;
    56import com.framsticks.util.lang.Numbers;
     7import com.framsticks.util.lang.Strings;
    68
    79import javax.annotation.concurrent.Immutable;
     
    3335        }
    3436
    35         public void save(Sink sink, Object value) {
    36                 sink.print(value);
    37         }
     37        // public void save(Sink sink, Object value) {
     38        //      sink.print(value);
     39        // }
    3840
    3941        protected <T> T tryCastAndReturn(Object value, Class<T> type) {
     
    9799        }
    98100
     101        @Override
     102        public <T> String serialize(T value) {
     103                return Strings.toStringNullProof(value);
     104        }
     105
     106        @Override
     107        public <T> T deserialize(String text, T currentValue, Class<T> type) {
     108                try {
     109                        return Casting.nullOrThrowCast(type, reassign(text, currentValue).getValue());
     110                } catch (CastFailure e) {
     111                        return null;
     112                }
     113        }
    99114}
Note: See TracChangeset for help on using the changeset viewer.